I'd like to open a bunch of documents (.txt or .docx or .ppt) using a batch file. Therefore, I have a batch file with the following structure:
"filename1.txt" &
"filename2.txt" &
If my text editor is open, this batch file will open the .txt files in the text editor and the batch file (DOS console) will close. If the text editor is not open, the batch file launches text editor, opens filename1.txt. Only after I close the text editor, the batch file (DOS console) will open filename2.txt. The batch file (DOS console) will close only after all the documents it opened are closed.
How do I prevent this? If I have a bunch of commands in a batch file, the batch file should launch the necessary applications and the documents and close, without waiting for the user to close the documents / application software.
Thanks for your time.
-Nina
Like UNIX ampersand: launch documents and close batch file
Moderator: DosItHelp
Re: Like UNIX ampersand: launch documents and close batch fi
The command lines of a batch file are executed synchronously by default. Use the START command to let it work asynchronously in this case.
Regards
aGerman
Code: Select all
start "" "filename1.txt"
start "" "filename2.txt"
Regards
aGerman
Re: Like UNIX ampersand: launch documents and close batch fi
Just adding here that I think some text editors can take multiple filenames/filespec on the command line, and open each file in a tab.