I have a weird problem where I have a simple batch file that runs another batch file, outputs what is on the screen to a log file, and then attempts to open the log file. The problem is, the log file doesn't open. Here is the code.
echo %date%, %time%: Deploying web site to Test1. > deploy.bat.log
Archive.deploy.cmd /Y /M:Test1 /U:<User> /P:<Password> >> deploy.bat.log
start "" notepad.exe deploy.bat.log
Through trial and err, I discovered that commenting the call to the external batch file makes the log file open, as expected.
echo %date%, %time%: Deploying web site to Test1. > deploy.bat.log
REM Archive.deploy.cmd /Y /M:Test1 /U:<User> /P:<Password> >> deploy.bat.log
start "" notepad.exe deploy.bat.log
Just to check, I also swapped out the other batch file with one that simply does echo Hello World
, but the problem remains - the log file does not open. I thought that there was something going on in the other batch file that was causing it to fail, but it does not appear to be the case - this example is still not working.
echo %date%, %time%: Deploying web site to Test1. > deploy.bat.log
Hello.bat
start "" notepad.exe deploy.bat.log
My question is, why doesn't the log file open and how do I fix it so it does?