Task Scheduler cannot find file

12,361

Try using:

pushd \\machine\share

within a batch file of your scheduled task. Network shared drives are only available from a user-run environment. "pushd" will allow it to be run in the context of the script.

When you're done use:

popd \\machine\share

to unmap the drive.

Reference: http://www.adrianbanks.co.uk/?p=41

Share:
12,361
user1630799
Author by

user1630799

Updated on June 04, 2022

Comments

  • user1630799
    user1630799 almost 2 years

    I have about 20 scheduled tasks on Windows Server 2008 R2 Standard. They have been working well for a couple weeks, then all of a sudden this weekend they all stopped. The tasks are all .bat files and .exe files, each working fine by clicking in explorer or running from cmd. I created a new task to run a .bat from the c: drive, and another to simply display a message, and always get the Last Run Result "The system cannot find the file specified. (0x8007002)" for all tasks.

    Here is a summary of the different fixes suggested:

    -Make sure user that runs the task has permission to use all files -All networked drives in .bat files should be referenced with full domain, not local drive letter

    -Uncheck "Run with highest privileges" in the General tab of properties

    -remove file path from program name in the action, and enter path into Start In

    -remove quotes from Start in

    -Unclick "start the task only if the computer is on AC power" in the conditions tab because some services can trick the server into thinking it has a battery

    -Unclick "Stop if the computer ceases to be idle" on the conditions tab

    -Make sure user is in Local Security Policy > Local Policies > User Rights Assignment > Log on as a batch job

    After trying all these, i still get "cannot find the file not specified" for run result and Task Start Failed for Task Category with Error Value 2147942402

    Anybody have another suggestion?? If nothing else hopefully this is a good summary of things to try for other issues.