script won't run on schedule - help
I give up. I have a batch file that should run every 2 hours, copying files from my computer to a Windows 2003 server. It worked flawlessly under XP Pro but now that I've moved to Windows 7 Professional the batch file will execute but doesn't
actually do anything. When I run the batch file manually, it works.
This is the script:
s:
if %errorlevel% neq 0 goto fail
c:
cd "\pic staging"
move *.* "s:\re photos"
goto end
:fail
beep
beep
beep
echo "Error connecting to server"
There is an old kb article indicating that " marks will prevent a scheduled batch file from running but it applied to Vista, not 7.
Right on schedule I get the following entries in the history of task scheduler:
Task Scheduler successfully finished "{fbbf51ad-a439-4fac-bc95-f89211493833}" instance of the "\Upload pics" task for user
Log Name: Microsoft-Windows-TaskScheduler/Operational
Source: Microsoft-Windows-TaskScheduler
Date: 11/22/2010 10:06:43 AM
Event ID: 102
Task Category: Task completed
Level: Information
Keywords: (1)
User: userpc\user
Computer: userpc
Description:
Task Scheduler successfully finished "{fbbf51ad-a439-4fac-bc95-f89211493833}" instance of the "\Upload pics" task for user "userpc\user".
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>102</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>102</Task>
<Opcode>2</Opcode>
<Keywords>0x8000000000000001</Keywords>
<TimeCreated SystemTime="2010-11-22T15:06:43.715372400Z" />
<EventRecordID>12729</EventRecordID>
<Correlation ActivityID="{FBBF51AD-A439-4FAC-BC95-F89211493833}" />
<Execution ProcessID="7140" ThreadID="3076" />
<Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
<Computer>userpc</Computer>
<Security UserID="S-1-5-21-2496878396-221071852-1712364028-1000" />
</System>
<EventData Name="TaskSuccessEvent">
<Data Name="TaskName">\Upload pics</Data>
<Data Name="UserContext">userpc\user</Data>
<Data Name="InstanceId">{FBBF51AD-A439-4FAC-BC95-F89211493833}</Data>
</EventData>
</Event>
November 22nd, 2010 10:18am
It could be that the task is not running with the necessary privileges. See
http://technet.microsoft.com/en-us/library/cc722152.aspx for further information.
See http://technet.microsoft.com/en-us/library/cc721846.aspx for general troubleshooting information.
Hope this helps.
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 12:50am
I've tried running it as myself and as admin. It simply does not work.
November 24th, 2010 9:40pm
Hi, it seems the problem related with your script, I suggest
asking
Scripting Forum for further help:
The Official Scripting Guys Forum!
Forum
·
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly
can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Regards,
Leo
HuangPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
November 25th, 2010 2:34am