enable-loudness-equalisation icon indicating copy to clipboard operation
enable-loudness-equalisation copied to clipboard

Error running the script, term 'reg' is not recognized - no access to system32\reg.exe

Open iospoisson opened this issue 1 year ago • 9 comments

`The term 'reg' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • . $env:HOMEPATH\EnableLoudness.ps1 -releaseTime 2
  •   + CategoryInfo          : ObjectNotFound: (reg:String) [EnableLoudness.ps1], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException,EnableLoudness.ps1`
    

iospoisson avatar Dec 20 '23 20:12 iospoisson

You need a standard Windows installation and a non modified environment Here is the normal output of a normal powershell:

PS C:\Users\falco> get-command reg

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     reg.exe                                            10.0.22... C:\WINDOWS\system32\reg.exe

As you see, Powershell has access to the windows path and will find the reg.exe in system32. It is not good enough to use the PowerShell functions for registry adjustments, only system32\reg.exe is able to bypass write restrictions without adding custom permissions to the sound registry keys.

So if you don't have access to system32\reg.exe this tool will not work. It is kind of a security issue that reg.exe is able to bypass the "no admin access, system only" restriction. So very likely that a hardened system with reduced permissions will not have access to system32\reg.exe

Falcosc avatar Dec 20 '23 21:12 Falcosc

How to solve this problem?

laminetrad avatar Dec 28 '23 14:12 laminetrad

You need to tell why your user does not have access to the standard registry edit tool. You need access to C:\WINDOWS\system32\reg.exe And your PATH variable needs to be correct. If you have done these checks and gain access to these system tools, then you can use get-command reg in powershell to confirm if you have a normal windows installation without restrictions. If get-command reg does not work, then you need to get a user with more permissions or you need to fix your environment setup.

Falcosc avatar Dec 28 '23 16:12 Falcosc

cmd I'm still getting this error, not sure what you said, I'm new to this, the PATH variable must be corrected how? And what do you mean by access to C:\WINDOWS\system32\reg.exe

laminetrad avatar Dec 28 '23 16:12 laminetrad

The Script calls "reg" With the help of the global Windows environment variable named "PATH", it looks for a reg.exe in multiple locations. On Windows, reg.exe is a system tool stored at C:\WINDOWS\system32\reg.exe

So you either don't have permissions to use your operating system tools, or you or your administrator did change the PATH variable or restricted your access to reg.exe.

Please ask somebody for personal tech support. I don't want to share any manuals which does touch your system tools, since if followed incorrectly things can break without you knowing how to undo. But I can give you a check to test if your system is a normal or not. You can type the following command into PowerShell to test if your access to reg.exe got fixed:

get-command reg

if everything is fixed on your computer, it will respond with the following output:

PS C:\Users\falco> get-command reg

CommandType     Name                               Version    Source
-----------     ----                               -------    ------
Application     reg.exe                            10.0.22... C:\WINDOWS\system32\reg.exe

Falcosc avatar Dec 28 '23 21:12 Falcosc

No problem, I've found the solution, thanks anyway.

laminetrad avatar Dec 28 '23 21:12 laminetrad

@laminetrad Was it something about how you run it? If yes, please share it, as long as it doesn't involve changing PATH or system32 :)

Falcosc avatar Dec 28 '23 21:12 Falcosc

It was about adding the right path to the Environment Variables

laminetrad avatar Dec 28 '23 23:12 laminetrad

No problem, I've found the solution, thanks anyway.

HOW FIX?

spadab avatar Apr 20 '24 11:04 spadab