Home » Questions » Computers [ Ask a new question ]

Execute multiple commands with 1 line in Windows commandline?

Execute multiple commands with 1 line in Windows commandline?

How can I execute multiple commands in the Windows commandline with just a single line?

Asked by: Guest | Views: 29
Total answers/comments: 5
Guest [Entry]

"Yes there is. It's &.

&& will execute command 2 when command 1 is complete providing it didn't fail.

& will execute regardless."
Guest [Entry]

At least in MS-DOS 6.22 I used to use the key Ctrl+T to get a kind of paragraph symbol. This worked just like the & mentioned by Phoshi. This will only work however, if you have doskey.exe running.
Guest [Entry]

If you are in powershell you can use ; to join commands.
Guest [Entry]

"I found that using 'START' fixed multiple commands working (I'm running Windows 10 Home). For example:

START chrome.exe ""page.web.com"" & timeout 20"
Guest [Entry]

"make a batch file with a short name ie bat.bat.

add cmd /c %1
cmd /c %2
rem

and so on to 9 lines and save

then use it with double quotes

bat ""command one"" ""command two"" ""command three""

cmd /c will run each command and shut down for the next line not saying this is better than && just that it's easy."