windows - Is it possible to create a batch file that creates another batch file via 'copy con' command? -
ok. question pretty explains itself. possible creat batch file, when executed create batch file via copy con command? like:
@echo off copy con file.bat @echo off echo hallo exit ^z start file.bat the problem encountered trying this, manualy need hit enter after ^z, , cannot find kind of cmd command replicate that. know if such thing possible? or there other way batch file re-create batch file or itself?
thank you.
it may possible issue escape code ^z , copy con why you? just normal redirection of echo command. this:
@echo off echo generating batch file echo echo hello world > hello.bat echo running batch file echo ---------- call hello.bat echo ---------- echo ta-da!
Comments
Post a Comment