Solved How do you disconnect a batch file from its commands?

January 4, 2013 at 10:44:00
Specs: Windows XP, 4 gb
I wrote a dos batch file that opens a webpage under firefox.
The problem is that the batch file remains connected to firefox as long as firefox is open.
I need firefox to remain open but disconnected from from the batch file and the cmd shell.
I need the execution of the batch file to continue past its firefox cmd and to terminate.
I know how to do this under bash but can it be done under DOS? PowerShell?
Closing the command shell kills firefox too so that doesn't work.


Thanks and grateful to have this forum for help - Randy


See More: How do you disconnect a batch file from its commands?

Report •


#1
January 4, 2013 at 12:42:41
✔ Best Answer
You can use the start command in a batch file, to manage that.
E.g.:
@echo off
echo "Start of Firefox"
start firefox.exe

echo "Start of Regedit"
start regedit.exe


Both commands will be executed and then the batch file will close, while the programs are still running.


Report •

#2
January 4, 2013 at 16:59:34
Recent versions of Firefox check the process that started it. If it's CMD, it binds itself to it's parent's console window. Why? Because the Mozilla team want you to move to a better browser, like Chrome.

How To Ask Questions The Smart Way


Report •

#3
January 5, 2013 at 03:58:14
Tried the batch file above by myself.
Works great.

Btw.: Chrome, better browser? Good joke ;.)


Report •

Related Solutions

#4
January 5, 2013 at 05:41:16
Hey, Google might spy on me, but at least they're speedy about it, and I can start it from a batch file. Google also knows how to update an application without harassing the user and breaking every extension.

EDIT: If you have Vista or above, the following script shows the behavior I'm talking about. Make sure FF is closed before running it, and feel free to close the console window after tge timer ends:

start firefox.exe
timeout /t 60

How To Ask Questions The Smart Way


Report •


Ask Question