[英]Scheduled Run of batch not logging output to file
I have two batch files with one calling the other 我有两个批处理文件,一个叫另一个
1) test1.bat
having content ping 127.0.0.1
1)
test1.bat
内容ping 127.0.0.1
2) test.bat
having content call "D:\\test1.bat" >>output1.txt 2>>&1
2)具有内容
call "D:\\test1.bat" >>output1.txt 2>>&1
test.bat
When I double click test.bat
, as expected, the output is logged into output1.txt
. 当我按预期方式双击
test.bat
,输出将记录到output1.txt
。 however, when i schedule the same test.bat
file, nothing gets logged. 但是,当我计划相同的
test.bat
文件时,没有任何记录。
I am scheduling this using the normal Windows task Scheduler. 我正在使用正常的Windows任务计划程序进行计划。 What am I missing here?
我在这里想念什么?
where is the working directory of the windows task scheduler? Windows任务计划程序的工作目录在哪里? i think you will find your output1.txt there;
我想你会在那找到你的output1.txt; or try
call "D:\\test1.bat" >> D:\\output1.txt 2>>&1
或尝试
call "D:\\test1.bat" >> D:\\output1.txt 2>>&1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.