Ask the Expert

Shutdown scripts written for file backup 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?

    Requires Free Membership to View

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.

This was first published in February 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: