views:

345

answers:

2

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.

A: 

"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".

Ioan
+2  A: 

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?

Joey
That's not true. Windows 2000 had reg.exe,because I ran the same query on windows 2000 not on advanced and it was successfull. But I don't know Advanced SP4
alice7
It didn't exist on my Windows 2000 Professional back when I still had it. It came in a Resource Kit as far as I remember. Anyway, *that's not the point here.* You're fishing something out of the registry *which is available as an environment variable.* There is no *need* to consult the registry here since you already have the value directly.
Joey
I completely agree with you Rossell.But I mistakenly took the wrong path of querying registry instead of using environmental variable.I didn't think about windows 2000 servers.
alice7