Summary
When a program or batch file is run by the Scheduler, it receives a copy of the system's environment--it does not have access to the "real" environment.
Any changes your program makes to the environment will only affect the program that makes the change. If you set an environment variable in a batch file (or in a program called by a batch file) that change will only affect other programs run in the same batch file.
Subsequent programs or batch files or those running at the same time will not "see" the environment changes made by your batch file or program.
More Information
This behavior is due to the Windows NT system architecture.