Problem solve Get help with specific problems with your technologies, process and projects.

Shutdown scripts written for file backup not working

A reader has created a batch file to back up files from one directory to another. It's been added as a shutdown script, and although the scripts are running, they're not working.

I have created a batch file to back up some files from one directory to another: "XCOPY /Y C:SOURCE *.* C:DEST *.*" I've used the gpeditor to add it as a shutdown script and although the shutdown window indicates it is running the shutdown scripts, it doesn't work. However it works if I double-click it. Any idea what might be happening?
It sounds like the problem may be with the policy and not the script itself. I'd start by using GPRESULT to figure out which GPOs have scripts set to run, and figure out the GUID of each GPO using the details in Microsoft Knowledge Base article 216359.

Next I'd look in the folder for each GPO and make sure that the scripts in question are getting replicated from there correctly. One common caveat with shutdown scripts and permissions is that the script has to be something the system account can run (it doesn't run as the Administrator). So make sure the script itself has the proper permissions to do so.

Also, if you're trying to copy from or to a server across a share, you'll probably need to specify a full UNC path (serversharefile.fil) or it may fail silently. If you're fairly sure the script is running, add some kind of diagnostic to the start of the script (i.e., an echo command to a local file, or something like that) to see if it's running and maybe failing because of something you hadn't foreseen.

Dig Deeper on Windows Server storage management

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.