Windows 2012 R2 Task Scheduler, call statement doesnt work
Posted on 2014-01-16
I have a Windows 2012 R2 server with a Task Scheduler entry. It executes a bat file nightly. In the bat file is a call statement to another bat file. The statements in the called bat file are not executing. When I run the bat file directly, they work. The task scheduler user is the same as the logged on user. I've tried different users. To debug, I skinnied the files down:
date /t >%ErrFile% 2>&1
time /t >>%ErrFile% 2>&1
echo EndFile >>%ErrFile% 2>&1
@echo subfile >>%ErrFile% 2>&1
When run directly the output file contains:
When run from the task scheduler, the output file does not contain the line "subfile". Please note that the production called bat file contains a lot of items; this scenario is just to demo the problem.
Am I missing something? How do I get the called bat file to execute?