3

Can you put multiple commands in a If command? What I have is looking to see if something is installed and if it is, send text to a file and change a variable. My example is lets say you want to see if edge is installed.... Set Edge=N

If  exist "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"  (
 echo Edge is installed >> C:\Temp\Message.txt
) Else (
echo Edge is Not installed >> C:\Temp\Message.txt
)

Where would I need to put the Set Edge=Y if it is installed?

1 Answer 1

2
If  exist "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"  (
 echo Edge is installed >> C:\Temp\Message.txt
 SET "EDGE=Y"
) Else (
SET "EDGE=N"&echo Edge is Not installed >> C:\Temp\Message.txt
)

Two ways.

Within a parenthesised block, you can place any number of statements you like, all on separate lines.

OR, you can use & to place a number of commands on one line.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.