Schedled Tasks and Environment Variables

Posted by Andrew J. Brehm on Server Fault See other posts from Server Fault or by Andrew J. Brehm
Published on 2012-11-16T09:24:27Z Indexed on 2012/11/16 11:03 UTC
Read the original article Hit count: 222

I have a scheduled task, a batch file, that uses an environment variables which is set system-wide.

On server 1, the scheduled task runs under a domain account and the environment variable works. The environment variable also exists in my session and when I runas as the service account.

On server 2, the scheduled task runs under a different domain account and the environment variable DOES NOT work. However, the environment variable does exist in my session and when I runas as the service account.

On both servers the environment variable has been set system-wide by the same script originally. The script runs again every now and then and as far as I can see noone has tempered with the environment variable.

The scheduled tasks are set up identically on the two servers (using the same XML file) and the two service accounts are identically configured (as far as I know).

What am I doing wrong?

© Server Fault or respective owner

Related posts about windows-server-2008-r2

Related posts about scheduled-task