Shutdown Task?

G

Guest

I need to add a backup script to the shutdown process. Or more acurately to
the logoff. I need it to run on XP Home and from the start menu shutdown
button so that it is idiot proof. It is a simple thing to add scripts to the
startup in the registry in the Run key. Is there a similar key for
executables at logoff? I can easily create a shortcut to the script on the
desktop that runs the backup and shutdown then remove the shutdown button
from the start menu, but would I would prefer to set the script up like you
can in group policies. Thanks in advance.
 
G

Guest

There is no option to set a Scheduled Task to run at shutdown or logoff.
That was the first thing I checked. The VBscript my abe promiseing but I
have never coded in VBS and the script has no instructions so looking at it I
am a bit lost as to what I would need to modify to get the funcionality I am
looking for.
 
B

Bob I

Humm, may have to "disable" the users shutdown options and write your
own batch file that ends in shutdown.exe.
 
G

Guest

This is the Script I wrote::



@echo off
:: variables
set drive=T:\_Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /v /y


:: This section Deletes Outlook files on T drive and copies Oulook files
from the C drive to the backup folder...

echo ### Backing up email and contacts (MS Outlook)...
if exist "%drive%\Outlook" del /f /s /q "%drive%\Outlook"
%backupcmd% "%USERPROFILE%\Local Settings\Application
Data\Microsoft\Outlook" "%drive%\Outlook"




:: This section Deletes Outlook Express files on T drive and copies Outlook
Express files from the C drive to the backup folder...

echo ### Backing up Email and Address Book (Outlook Express)...
if exist "%drive%\Address Book" del /f /s /q "%drive%\Address Book"
%backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book"
"%drive%\Address Book"
if exist "%drive%\Outlook Express" del /f /s /q "%drive%\Outlook Express"
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities"
"%drive%\Outlook Express"




:: This section Deletes Windows Live Mail files on T drive and copies
Windows Live Mail files from the C drive to the backup folder...

echo ### Backing up Email and Contacts (Windows Live Mail)...
if exist "%drive%\Windows Live Contact" del /f /s /q "%drive%\Windows Live
Contact"
%backupcmd% "%USERPROFILE%\Local Settings\Application
Data\Microsoft\Windows Live Contacts" "%drive%\Windows Live Contacts"
if exist "%drive%\Windows Live Mail" del /f /s /q "%drive%\Windows Live Mail"
%backupcmd% "%USERPROFILE%\Local Settings\Application
Data\Microsoft\Windows Live Mail" "%drive%\Windows Live Mail"
if exist "%drive%\Contacts" del /f /s /q "%drive%\Contacts"
%backupcmd% "%USERPROFILE%\Contacts" "%drive%\Contacts"



:: This section copies RENTROLL files from the C drive to the backup folder...

echo ### Backing up RENTROLL...
%backupcmd% "C:\RENTROLL" "%drive%\RENTROLL"




:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

:: use below syntax to backup My Documents...
:: %backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"

echo Backup Complete!

timeout 05




It runs perfectly for what we need. I could very easily add :

SHUTDOWN -s -t 01

to force shutdown and we get the backup and shutdown. Thing is that if we
sell the property (i.e. the computers) we do not need the extra trouble of
restoring the shutdown button on the start menu. But we are rolling out
Faronics Deep Freeze and we have critical data on the C drive that must
remain dynamic and can be backed up to a thawspace then restored during
maintanace mode or if the machine User needs to shut the machine down.

It may come down to removeing the shutdown button and useing the sript
shortcut. I just want to make sure that when I go to my boss that I can
garantee that I have performed my due dillagence.

If you have any other ideas I would much apreciate it.
Thanks
 

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