1.

Solve : Starting Independent Processes via DOS Command Line?

Answer»

Hi all.

I need to be able to start a process via the command line, however that process should not stop even if the calling DOS window instance is killed.

I've tried all kinds of variations USING things like:

Code: [Select]C:\>START my_batch_file
and

Code: [Select]C:\>START /b my_batch_file
The batch file will run (and continue to run) but when I close the DOS window, the batch process dies with it.

Is there any way that one can start said batch file and have it continue running until - well - forever?

Cheers,

ZeroAh - I forgot the useful technical bits...

This will be running on Windows Server 2003 Standard, using whatever DOS interpreter is installed standard there. My development environment is Window XP Pro.Quote

This will be running on Windows Server 2003 Standard, using whatever DOS interpreter is installed standard there.

You've left DOS behind, pal! You're in NT territory now...

What is in the batch file? Have you tried something like this...

Code: [Select]start "" "some-executable.exe" "parameter 1" "parameter 2" "etc"

start "title" "path-to-executable""parameter 1""parameter 2"....

"Title" can be a null string but should not be omitted...

Example:-

Code: [Select]@ECHO off
start "" "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
exit

IEXPLORE will continue running after the batch has finished.

Unless you want it hidden, like the batch file is doing something but you cant see it......Yeah, I'm using:

Code: [Select]C:\>START [application name and parameters here]

The problem I'm having is that the process the START command is creating will stop if the original CMD instance is CLOSED or stopped. I'm TRYING to figure out if there's a way to spawn a completely new and independent process.

I think the problem I am having is with my environment - it is a Java web server that's making the call to the command line. contrex's solution works fine under normal circumstances. I just think I've got abnormal circumstances...

Thanks for all your suggestions!


Discussion

No Comment Found