Ofek Gila
Ofek Gila

Reputation: 703

How to create a batch file that creates a batch file that creates a batch file

I want to create a batch file called test1 that creates a batch file called test2 that creates a batch file called test3 I made this:

@ECHO OFF
ECHO ECHO > test3.bat > test2.bat

But it doesn't work. Any help?

Upvotes: 1

Views: 173

Answers (1)

Stephan
Stephan

Reputation: 56228

you will have to escape special chars like >with a caret ^

echo echo echo hello ^>t3.bat >t2.bat
type t2.bat
call t2.bat
type t3.bat
call t3.bat

Upvotes: 2

Related Questions