Run something at shutdown?

  • Thread starter Thread starter Alain Dekker
  • Start date Start date
A

Alain Dekker

Hi,

I know you can run a batch file at startup by putting a shortcut to the
batch file in your Start\Programs\Startup folder.

Is there any way to run something that shutdown, so that if the computer is
restarted, or shut down, then a different batch file/program is run? I'd
like to make a copy of a file on disk as the computer shuts down, and then
have a look at the copy and the file just after the reboot to debug what is
happening as the computer at either end of power on.

Many thanks,
Alain
 
Hi,

I know you can run a batch file at startup by putting a shortcut to the
batch file in your Start\Programs\Startup folder.

Is there any way to run something that shutdown, so that if the computer is
restarted, or shut down, then a different batch file/program is run? I'd
like to make a copy of a file on disk as the computer shuts down, and then
have a look at the copy and the file just after the reboot to debug what is
happening as the computer at either end of power on.

Many thanks,
Alain

If you are using XP then you can set up Shutdown Scripts from the
"Group Policy Editor", look for "GPEDIT.MSC" in your system32
directory

Not sure if that is XP only or not though

Vin
 
Hi Douglas,

No, I'm debugging c (not MFC/C++) code, amd as part of the running of the
code, files are generated. I need something from the OS (like the Startup
folder) that can run at shut down so I can preserve the file as the computer
shuts down. On reboot, the file is overridden.

Many thanks,
Alain
 
I was thinking along the lines of running a program at startup, this program
does nothing except sit there and wait for the WM_ENDSESSION message and
write's your file.
 
NT/2000/XP have Shutdown and Logoff scripts. Type GPEDIT.MSC in Start Run (pro only) and look under the two Windows Settings folders.
 
Back
Top