Running process before windows shutdown

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?
 
G

Guest

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?
 
M

Mr. Arnold

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top