Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start a process in a new window from a batch file

I have written a batch file (.bat) in windows. I want to execute a particular process in a new window. How do I do this?

Example

a.py -s 3 -l 5 b.py -k 0  -> I want to start this in a new window and let the original batch file continue  C:\program.exe ... .... 
like image 555
Bruce Avatar asked Jun 10 '11 12:06

Bruce


People also ask

How do I run a Windows process from the command line?

Type "start [filename.exe]" into Command Prompt, replacing "filename" with the name of your selected file. Replace "[filename.exe]" with your program's name. This allows you to run your program from the file path.

How do I get a batch file to run automatically when I start Windows?

Run a batch file at loading of Windows 8 and 10Press Start, type Run, and press Enter . In the Run window, type shell:startup to open the Startup folder. Once the Startup folder is opened, click the Home tab at the top of the folder. Then, select Paste to paste the shortcut file into the Startup folder.

What does %1 mean in a batch file?

When used in a command line, script, or batch file, %1 is used to represent a variable or matched string. For example, in a Microsoft batch file, %1 can print what is entered after the batch file name.


1 Answers

Use the start command:

start foo.py 

or

start "" "c:\path with spaces\foo.py" 
like image 151
Anders Avatar answered Oct 12 '22 14:10

Anders