Here is our setup:
Server A - Windows 2008 R2
PHP script on server A that copies files
Drive O: on computer B - Windows computer
contains source files
Drive V: on computer C - Debian Linux computer
We have the PHP script on server A that copies files from the mapped drive O: (on computer B) to the mapped drive V: (on computer C). The script works perfectly when run manually from the command line.
However, when the same PHP script is run from Task Scheduler it can't see the folders on drive O:. I had it echo out is_readable and is_writable on the O: drive folders, and when run from CLI they both return 1 but when run from task scheduler they return 0. I also had both echo out get_current_user and they both return the same user.
The scheduled task is set to the same user the CLI one is, and is set to run with highest privileges.
The scheduled task calls a batch file that then calls the php file. This is the contents of the batch file:
start "" /b /separate php -f "d:\scripts\get_files.php"
If I run the batch file manually the script works, so it definitely seems to be something with the scheduled task itself, but I can't figure out what. Any help would be greatly appreciated. Thank you!