October 18th, 2010, 02:58 PM
Batch file to evaluate value in regestry
I need to evaluate this regestry value
reg query "HKCU\Control Panel\International" /v "sCountry" | find /i "Canada"
If the returned value is not Canada i need it to run
I'm new to writing batch files so i'm sure this is just an IF statement but i'm unsure of the syntax and how to tie it in with the reg query error level.
This is what i have now but it does not work and i'm not sure i've got the ifstatement right.... it looks right but i'm new so.
Any help would be great.
reg query "HKCU\Control Panel\International" /v "sCountry" | find /i "Canada" > output.txt
if errorlevel 1 goto not_exist
October 19th, 2010, 08:44 AM
Never mind, turns out the error was with the way i was testing this. It does work.
Originally Posted by dsfx