Running process before windows shutdown

  • Thread starter Thread starter AxOn
  • Start date Start date
A

AxOn

Hi,

I'm trying to make an application that runs robocopy on some files
over a network and then closes, when users shutdown or log off windows
xp. The robocopy process on its own works fine, but when the app is
running while I log off, windows session ending process hangs, and I
get this cmd.exe error: The application failed to initialize properly
(0xc0000142)

So my question is can I somehow work around this error or can I get
windows to wait till my app is closed before shutting down?
 
Hi,

I'm trying to make an application that runs robocopy on some files
over a network and then closes, when users shutdown or log off windows
xp. The robocopy process on its own works fine, but when the app is
running while I log off, windows session ending process hangs, and I
get this cmd.exe error: The application failed to initialize properly
(0xc0000142)

So my question is can I somehow work around this error or can I get
windows to wait till my app is closed before shutting down?

I don't think you can - because an app could hang the Windows log off.

Why don't you do a scheduled copy instead - or real-time copies?
 
AxOn said:
Hi,

I'm trying to make an application that runs robocopy on some files
over a network and then closes, when users shutdown or log off windows
xp. The robocopy process on its own works fine, but when the app is
running while I log off, windows session ending process hangs, and I
get this cmd.exe error: The application failed to initialize properly
(0xc0000142)

So my question is can I somehow work around this error or can I get
windows to wait till my app is closed before shutting down?

You might be able to do something while the app is running to hold the
shutdown process until the app is finished.

It may be worth a shot or look at the Windows API functions as well. There
may be a API function that can stop the shutdown.

http://www.vbforums.com/showthread.php?t=378775
 
Back
Top