Scheduled Task not completing on 2k3

September 14, 2010 at 10:21:47
Specs: Windows 2003 - SP2
I have a bat file that I can run manually without issues. When I try to run it as a scheduled task in Windows 2k3 Server its not completing. I am seeing an exit code of 0x0 and I have enabled my own logging that also shows an exit code of 0 but its not running. Basically what happens is I delete several files (this part works regardless). Then I have curl an asp page. The curl of the page is what is not completing although after my curl command I have it logged to show the exit code and that is also showing 0. Any thoughts? Here is my code for reference:

-------
@echo off
DEL /S C:\Inetpub\wwwroot\*.mp3

curl.exe -u user:password http://www.mysite.com/clear.asp
set returncode=%errorlevel%
echo cURL returned error code %returncode% >> C:\Inetpub\statuslog.txt

set returncode=
-----

The username and password that I have in scheduled tasks is an administrator and logged in as that user the bat file runs fine when run manually just not via schedule task.


See More: Scheduled Task not completing on 2k3

Report •

#1
September 14, 2010 at 11:36:00
might try including the path in the curl statement like
c:\windows\system32\curl.exe

Report •

#2
September 14, 2010 at 13:12:57
Actually curl.exe is in the system32 directory so not needed since thats part of the environment variables. However, I had previously tried that anyways and makes no difference.

Report •

#3
September 14, 2010 at 13:16:27
I just deleted the task and recreated it, I was able to manually run it this time without issue so will see if it works now as scheduled. Maybe something corrupt with the original task creation.

Report •

Related Solutions

#4
September 14, 2010 at 13:20:58
You did everything correctly with logging in under the account that you are running it under. No other thought came to mind for the failure.

Report •

Ask Question