[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/12/2009 at 03:02AM PDT, ID: 24804016
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Run a batch file as a scheduled task in Windows Server 2008

Asked by JazIT in Windows Batch Scripting, Windows Server 2008

Tags: Server 2008

I 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.DOMAIN
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-TaskScheduler/Operational
Source:        Microsoft-Windows-TaskScheduler
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.au
Description:
Task Scheduler successfully completed task "\Hourly Backup of Guarde Data" , instance "{1d1a713f-8433-45ac-b39f-f19548e29a2d}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 4.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-TaskScheduler" Guid="{de7b24ea-73c8-4a09-985d-5bdadcfa9017}" />
    <EventID>201</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>201</Task>
    <Opcode>2</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2009-10-12T09:22:42.127Z" />
    <EventRecordID>900309</EventRecordID>
    <Correlation ActivityID="{1D1A713F-8433-45AC-B39F-F19548E29A2D}" />
    <Execution ProcessID="8076" ThreadID="7684" />
    <Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
    <Computer>Server.domain.com.au</Computer>
    <Security UserID="S-1-5-21-436374069-308236825-1801674531-500" />
  </System>
  <EventData Name="ActionSuccess">
    <Data Name="TaskName">\Hourly Backup of Guarde Data</Data>
    <Data Name="TaskInstanceId">{1D1A713F-8433-45AC-B39F-F19548E29A2D}</Data>
    <Data Name="ActionName">C:\Windows\SYSTEM32\cmd.exe</Data>
    <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
[+][-]10/12/09 03:27 AM, ID: 25549887

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows Batch Scripting, Windows Server 2008
Tags: Server 2008
Sign Up Now!
Solution Provided By: oBdA
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10/12/09 05:07 AM, ID: 25550427

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625