The UNC change seems to have sorted it. I will confirm tomorrow.
I didn't know that UNC conventions were essential within a script that runs within Task Schduler!Thankyou
Main Topics
Browse All TopicsI am embarrassed at having to ask for help here but I have spent enough time on it myself.
All that I am trying to do is run a batch file as a scheduled task in Windows server 2008. I have read most of the other similar issues on this site with no success. This server is the AD server & is logged on as the Administrator. The batch file is a very simple xcopy from one mapped drive to a local drive.
cd \
cd c:\users\administrator.DOM
xcopy g:\mergedata\*.* d:\guardebackup\backup /e /d /i /y > c:\merge.txt
According to the task scheduler history the script has completed with the result 0x0
Log Name: Microsoft-Windows-TaskSche
Source: Microsoft-Windows-TaskSche
Date: 12/10/2009 7:52:42 PM
Event ID: 201
Task Category: Action completed
Level: Information
Keywords:
User: ROYALPARK\administrator
Computer: RPSrv01.chevronglass.com.a
Description:
Task Scheduler successfully completed task "\Hourly Backup of Guarde Data" , instance "{1d1a713f-8433-45ac-b39f-
Event Xml:
<Event xmlns="http://schemas.micr
<System>
<Provider Name="Microsoft-Windows-Ta
<EventID>201</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>201</Task>
<Opcode>2</Opcode>
<Keywords>0x80000000000000
<TimeCreated SystemTime="2009-10-12T09:
<EventRecordID>900309</Eve
<Correlation ActivityID="{1D1A713F-8433
<Execution ProcessID="8076" ThreadID="7684" />
<Channel>Microsoft-Windows
<Computer>Server.domain.co
<Security UserID="S-1-5-21-436374069
</System>
<EventData Name="ActionSuccess">
<Data Name="TaskName">\Hourly Backup of Guarde Data</Data>
<Data Name="TaskInstanceId">{1D1
<Data Name="ActionName">C:\Windo
<Data Name="ResultCode">4</Data>
</EventData>
</Event>
There is a second action configured, that sends me an e-mail & I receive that so the task completes but the batch file does not run. If I double click on the script it works. If I enter the script file into a command prompt it works.
I have tried the following.
1) Changing the .bat to a .cmd
2) Within the "Action" I have tried placing just the script file name, ie MergeDataHouly.bat & placing the location in "start in", ie C:\scripts as per another post.
3) I have edited the script to not change the current directory, ie just xcopy .....
Please assist in what should be a simple task
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: oBdAPosted on 2009-10-12 at 03:27:44ID: 25549887
Don't use mapped drive letters in a scheduled task. Use UNC paths, and make sure that the account the task is running under has enough permissions. It's best to use dedicated account for this, not one that's used for interactive logons as well.
gedata\*.* d:\guardebackup\backup /e /d /i /y > c:\merge.txt
xcopy \\SomeServer\SomeShare\mer