windows 7 task scheduler doesn't use updated path

旧街凉风 提交于 2019-12-10 15:16:21

问题


I just noticed that windows 7 task scheduler doesn't use the latest updated environment path variable. Task scheduler is up and running and I changed the path variable. New processes that run in the task scheduler have the old path. I had to kill the taskeng.exe so that it can start using the latest path. So looks like Task scheduler spawns new processes as child processes rather than new parent processes. Is there any work around for this without killing the task scheduler process?

Regards, AJ


回答1:


Use cmd /c to start the program, this will allow access to environment variables. eg:

cmd /c start %my_exe_path%\myexe.exe




回答2:


Changing the account that the job is running under in the scheduler worked for me (on win server 2008 r2).



来源:https://stackoverflow.com/questions/11824319/windows-7-task-scheduler-doesnt-use-updated-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!