1
2
I have an executable that needs to be run on an E:/ drive, Windows Server 2012 is installed on the C:/ drive. I've created a scheduled task that has the full path to the target executable (E:/stuff/target.exe), and has the working directory set (E:/stuff/).
This fails, task scheduler tells me that the directory name is invalid. If i remove the working directory, it tells me access is denied. This can't be right, The entire drive is both shared, and has file permissions set to "everyone" with full control. The account running the task can definitely run it (i can do so through cmd.exe). Sidenote: I've tried all permutations of the path, using backslashes, forward slashes, quotes, and non-quotes. This is not due to KB2452723.
I've tried having a batch file which uses "CD" to set the working directory to E:/stuff/, then call the program, which works when i run it. Unfortunately, when run through Task Scheduler, it never changes the working directory, and tries to call target.exe from the system drive (where it doesn't exist).
I've also tried making a symbolic link ("mklink /D") from C:/temp/ to E:/stuff/, in the vain hope that i could fool task scheduler, but it won't follow the link, and tells me that the directory could not be found.
I cannot figure out why task scheduler would fight this so hard, nor what the correct practice would be to get this to work. Has anyone successfully run a file on a non-system drive with task scheduler?
Is this E: drive a network mapped drive? – afrazier – 2013-07-22T00:31:42.380
It's a local drive. I should have mentioned, this is running on a VM, so it's probably actually the same physical drive as the C: drive. – Knetic – 2013-07-22T00:41:14.617
A few requests, can you do the command
NET USE
from a command prompt and copy the output here, also can please runicacls E:/stuff
and copy the output of that too? (please edit your question with these updates, don't post them as comments) – Scott Chamberlain – 2013-07-22T02:56:25.213