I have the following two batch files, bat1.bat
calls bat2.bat
.
bat1.bat:
@echo off
echo bat1 start >> C:\battest\log.log
call bat2.bat
echo bat1 end >> C:\battest\log.log
bat2.bat:
@echo off
echo bat2 >> C:\battest\log.log
When I run bat1.bat
directly in command line, the output is as expected as below:
bat1 start
bat2
bat1 end
However, when I create a task in Windows Task Scheduler to run bat1.bat, I only get this:
bat1 start
bat1 end
It seems the call bat2.bat
has no effect. Why?