• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1730
  • Last Modified:

Scheduled tasks not working.

I have a scheduled task set to run every night at 7. The run as is set to Administrator, and the password is correct, the .bat file works when I manually run it, the following services are started, RPC, Task Scheduler, and RunAs Service. And the computer never turns off.  Not sure where to go from here.

-Chris
0
cdmt00
Asked:
cdmt00
  • 2
  • 2
1 Solution
 
SteveGTRCommented:
When you say it doesn't work, what do you mean?

Can you put some debugging code in the batch file to test where it fails?

(echo [%date%, %time%] Before this statement)>>"c:\temp\temp.txt"

this statement...

(echo [%date%, %time%] After this statement)>>"c:\temp\temp.txt"

You can change the destination and name of the debugging file from c:\temp\temp.txt if required.

One common problem of failure is attempting to use a mapped drive in a scheduled task. Use a URN instead (\\server\share\dir).

Another common problem is attempting to reference a network resource with an account that doesn't have access to the resource. This can be solved by running the account using a domain account with access to the reference.
0
 
cdmt00Author Commented:
so i cant use a mapped drive? that could be my problem, but It works when I run the script manually, i will try the debugging code.
0
 
SteveGTRCommented:
The mapped drive is particular to the current user. Use the URN instead.
0
 
cdmt00Author Commented:
It looks like that might have fixed it. I will leave this question open until tomorrow because I cannot run the .bat while users are using the files. Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now