Wednesday, January 4, 2012

Run two commands on one command line in cmd.exe

It's easy to run multiple commands on a single line by using cmd.exe:

#cd data & notepad file.txt


Advanced combinations that run the second command only if the first was successful:

#< first command > && < second command runs if first is successful >


Advanced combinations that run the second command if the first command has an error by using ||

#< first command > || < second command runs if first has an error >

 




No comments: