I
IF
Hi,
On Win2000, I wrote a script which uses the command 'net use
<drive> \\server\share /user:<username> <password> /persistent:no',
and copies some files to that drive. The script works successfully
when it is executed by a specific user from the command line.
However, 'net use' fails when executed as a command in a
scheduled task for the same user.
The advanced log in the task scheduler indicates that the job failed
with a return code of 2.
I tried ending the 'net use' command with a redirect to an output file
(net use... > output), but no information was available in that file.
Then, I added the command 'set > env_variables' to the script. The file
'env_variables' was created, and the environment variables are
exactly the same for the user as in foreground.
Thus, given that the 'net use' command works in foreground, and that
the scheduled task executes and displays the correct environment
variables, why does the 'net use' command fail in background?
Any ideas would be greatly appreciated.
Also, is there any way for me to get more detailed information in the
Advanced Log of the Scheduled Tasks, or through other means?
Thanks,
IF
On Win2000, I wrote a script which uses the command 'net use
<drive> \\server\share /user:<username> <password> /persistent:no',
and copies some files to that drive. The script works successfully
when it is executed by a specific user from the command line.
However, 'net use' fails when executed as a command in a
scheduled task for the same user.
The advanced log in the task scheduler indicates that the job failed
with a return code of 2.
I tried ending the 'net use' command with a redirect to an output file
(net use... > output), but no information was available in that file.
Then, I added the command 'set > env_variables' to the script. The file
'env_variables' was created, and the environment variables are
exactly the same for the user as in foreground.
Thus, given that the 'net use' command works in foreground, and that
the scheduled task executes and displays the correct environment
variables, why does the 'net use' command fail in background?
Any ideas would be greatly appreciated.
Also, is there any way for me to get more detailed information in the
Advanced Log of the Scheduled Tasks, or through other means?
Thanks,
IF