I am trying to create a batch file that creates another batch file then outputs to a text file when a certain exe closes. @ECHO OFF
ECHO restarted exe %%Date%% %%Time%% >> C:\Log.txt >>"C:\test.bat"The test.bat is created but it only displays: restarted exe %DATA% %TIME%
Is there any way for it to include the >>C:\log.txt ?
The redirection symbol > has special meaning in the Command Shell so must be Escaped in order to be treated as a literal. ^>^> should work. Good luck
Please come back & tell us if your problem is resolved.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |