Can't see what is wrong with this
I'm writing a batch file that involves querying the OS to see if it is running Windows XP.
The failing bit of code is as follows:
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion" /v ProductName | FIND "Microsoft Windows XP"
When I run this, I get the following error:
ProductName REG_SZ Microsoft Windows XP
Error: They system was unable to find the specified registry key or value
I cannot see what is wrong with the command? Any pointers? Is it a stupid little spelling mistake?
Edit: These values are in the registry and I'm definitely running it on XP :-)