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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With