Link to home
Start Free TrialLog in
Avatar of mdoland
mdoland

asked on

Fork off a command in a batch script

I have command file (.bat) that runs when I logg in. It performs a number of commands. Also, I want it to kick up a notepad with a certain .txt file. However, the command script still stays upp since I don't want to close the notepad window. I think I need to fork it off. How do I do that?
ASKER CERTIFIED SOLUTION
Avatar of DdVar
DdVar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oBdA
oBdA

Sorry, somehow missed notice DdVar's comment.

Maybe some additional things to note about "start": if the program or file (if the file has an association, "start somefile.doc" or whatever will work as well) you want to start needs to be enclosed in quotes, the "title" argument is mandatory.
The following command will just open a command prompt with the program file as title:
start "C:\Program files\acme\acme.exe"

Open in new window

"start" in this case treated the program as window title; to avoid this, specify the title directly after "start" (setting the title will only work if you open a command prompt, not with a GUI window):
start "Title argument, will be ignored" "C:\Program Files\Windows NT\Accessories\wordpad.exe"

Open in new window

start "This is a command prompt with a custom title" cmd.exe

Open in new window