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\Environment" /v PROCESSOR_ARCHITECTURE.
I don't know if this helps or not. But the OS is W2k Advances SP 4 on the server.
Windows 2000 didn't include
reg.exe
yet. However, you can find the processor architecture in the environment variables: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?
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.
"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".