Link to home
Start Free TrialLog in
Avatar of mellor
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?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

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 mellor
mellor

ASKER

Thanks - for the bad news!!
Sorry - you might want to take a look int svrany.exe from the resource kit to make things easier...