Link to home
Start Free TrialLog in
Avatar of Newbie0000
Newbie0000Flag for Canada

asked on

Correct way to use if / else command

Help with syntax please.

I am looking for a reg key and if it's there great put a flag file in if it's not install from a network share, just not sure how to use the else command.

reg query "HKEY\xxx\xxx\Uninstall\{xxxx}"
     if %errorlevel% EQU 0 (
     echo %date% %computername% Installed >> "C:\Windows\System32\Flags\xxx.txt"
     )

This is where I would like to put "Else" install "\\server\share\xxx.cmd" /qn

I'm not sure how to use the else command

I am very new to scripting and you help is appreciated.
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Newbie0000,

Just checking if you still need help with this?
Avatar of Newbie0000

ASKER

Sorry I got pulled onto something else but I will look at is and get back to you hopefully this week, I am sure it will work since you have provided me with very good guidance before!