mellor
asked on
Creating a detached process?
I am having dificulity creating a detached process. (Not to be confused with an NT service)
Currently the only way I can create a fully detached process is by writing a 'start' command to a temporary file then calling 'CreateProcess' with a command like:
'cmd.exe /c at 20:15 temporaryfile.bat'. This is jumping though hoops, and the NT schedular service has to be running.
Calling CreateProcess() with the DETACHED_PROCESS flag with or without CREATE_NEW_PROCESS_GROUP does not seem to create a process that continues running after a user logs off. Also ShellExecute() does not seem to have a way of creating a detached process.
Any ideas?
Currently the only way I can create a fully detached process is by writing a 'start' command to a temporary file then calling 'CreateProcess' with a command like:
'cmd.exe /c at 20:15 temporaryfile.bat'. This is jumping though hoops, and the NT schedular service has to be running.
Calling CreateProcess() with the DETACHED_PROCESS flag with or without CREATE_NEW_PROCESS_GROUP does not seem to create a process that continues running after a user logs off. Also ShellExecute() does not seem to have a way of creating a detached process.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry - you might want to take a look int svrany.exe from the resource kit to make things easier...
ASKER