I'm running a batch file command on a server which is using reg query to find out the procesor_architecture of the machine(AMD64 or x86).
And I'm getting this error, does anyone know what could be the issue. And what all things have to be checked first before running this command on that specific server.
This is the command:
reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environ开发者_Python百科ment" /v PROCESSOR_ARCHITECTURE.
I don't know if this helps or not. But the OS is W2k Advances SP 4 on the server.
I have seen this when a tech used a batch file variable called 'path' in a script. Set the PATH variable back to C:\Windows\System32 and that should fix your reg.exe not found errors.
Windows 2000 didn't include reg.exe
yet. However, you can find the processor architecture in the environment variables:
> echo %PROCESSOR_ARCHITECTURE%
AMD64
Re-reading your question: Heck, that's what you've been trying anyway, so why bother with the convoluted way when you can just grab the value directly?
"reg" does not appear to be in the path in the environment in which you are executing it. Try using the full path to "reg".
The solution to this error is to add the path C:\Windows\System32\ to the Environment Variables:
Right click the My Computer icon then choose properties.
Select the Advanced tab and then click Environment Variables.
At the system variables panel, choose Path then click the Edit button.
Add C:\Windows\System32, the paths are separated by a semicolon.
精彩评论