Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple commands in a batch file?

I am having the below commands in a batch file. While i try to run it using Execute action in Finalbuilder project, 1st command alone was run. So, i planned to have each commands in various batch files. Could anyone please help me to run all the commands in a single batch file run with the delay (if required)?

Commands:

   dnvm list
   dnvm install 1.0.0-beta8
   dnvm use 1.0.0-beta8 –p
   dnvm -Args alias default 1.0.0-beta8

Also i am getting the below error when run the last command through batch file using Execute action in FinalBuilder project.

Error: Invoke-Expression: Positional parameter cannot be found that accepts argument

like image 631
Karthi Avatar asked Jan 21 '16 11:01

Karthi


People also ask

How do I run multiple commands in one batch file?

Try using the conditional execution & or the && between each command either with a copy and paste into the cmd.exe window or in a batch file. Additionally, you can use the double pipe || symbols instead to only run the next command if the previous command failed.

Can you run 2 command prompts at once?

Click Start, type cmd, and press Enter to open a command prompt window. In the Windows taskbar, right-click the command prompt window icon and select Command Prompt. A second command prompt window is opened.


1 Answers

call dnvm list
call dnvm install 1.0.0-beta8
call dnvm use 1.0.0-beta8 –p
call dnvm -Args alias default 1.0.0-beta8

call will execute the target then return to the following line of the batch when it terminates.

like image 86
Magoo Avatar answered Oct 02 '22 15:10

Magoo