
Help: Modify shutdown routine
Quote:
>What you want to do is not practical, if it is possible at all.
>Modifying the action of Start - Shutdown would require hacking the basic
>commands (possibly contained in Explorer.exe).
>However, you can create a script and add a shortcut to it directly in =
>the Start Menu, so it will appear above the listing of standard items =
>(Start, Run, etc.). Then use that for Shut Down instead of the Windows =
>Shut Down option at the bottom of the menu. The script could be as =
>simple as these 2 lines:
>MsgBox "Don't forget end-of-the-day tasks!"
>CreateObject("Shell.Application").ShutdownWindows
That's deffo the best solution for within-the-GUI changes, I agree.
One caveat: Take steps to guard against multiple instances and failed
shutdowns. For example, if renaming files or anything else that
should be done once and once only, you may want your script to check
that another instance of it is not running. Latency could be a
problem there, so make that check after doing any time-consuming
stuff, e.g.: Set "I exist" flag, spend time, check for "I exist" flag
On failed (cancelled) shutdowns; if the script returns from
ShutdownWindows (as you'd not expect it to do), you should then
reverse sensitive changes. Thinking of situations where a DOS app is
running or a file has to be saved, and user chooses to cancel rather
than proceed with the shutdown process in the dialog offered.
OTOH, for outside-the-GUI changes (e.g. "Restart in Linux"), one can
usefully edit "Exit to DOS.bat", which controls the option to "Restart
in MSDOS Mode" so that you can, um, re-orientate that facility :-)
Quote:
>----------------- ----- ---- --- -- - - - -
Clippit Millennium says:
"It looks like you're writing a virus. Need some help?"
Quote:
>----------------- ----- ---- --- -- - - - -