Batch file creating another batch file

September 28, 2011 at 19:55:22
Specs: Windows 7, Pentium R/3GB Ram
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 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 ?

See More: Batch file creating another batch file

Report •

September 28, 2011 at 23:37:16
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.

Report •
Related Solutions

Ask Question