W T run script or .bat at shutdown?

K

KG

I would like to run a short file backup script or .bat at shutdown on XP home, any idea how to do?
 
M

Mark L. Ferguson

You would have to give up the standard ways to shutdown, and use the a script to do both backup, and then shutdown. Pro has Policy
to set a logoff script, Home does not.
 
K

KG

You would have to give up the standard ways to shutdown, and use the a script to do both backup, and then shutdown. Pro has Policy
to set a logoff script, Home does not.

OK does this mean it can not be done or, it can not be done easily?
 
M

Mark L. Ferguson

Well, relative to your understanding of .bat or .vbs code, you can write something that does all you want with one click of some
specially created shortcut for your shutdown routine.

--down.bat--
REM ---backup the files
start /WAIT copy c:\myfile.txt d:\backupfolder
REM ---and out like a light
shutdown /s /f /t 00
--end file--

--down.vbs--
set shell = createobject("wscript.shell")
shell.run "copy c:\myfile.txt d:\backupfolder", 0, true
shell.run "shutdown /s /f /t 00"
--end file--

The Windows Script Host is especially good at handling the file system objects, if you care to get into it.
http://msdn.microsoft.com/library/en-us/script56/html/sgWorkingWithFiles.asp?frame=true
 

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