How do I make long commands go over multiple lines in a Vista/DOS batch file?
views:
11670answers:
1
+27
A:
I believe you can break up long lines with the caret ^ as long as the next line starts with a space.
copy file1.txt file2.txt
would be written as:
copy file1.txt ^
file2.txt
Wayne
2008-09-16 03:06:37
You can start the next line without a space if you add a space just before the `^` and after your command text.
Joseph Daigle
2008-09-16 03:21:46
Note: that a caret ^ after copy and file1.txt on a new line won't work.
Gavin Miller
2008-11-10 22:01:19
**Thanks Joseph**. I fiddled with this a little before and could not use more than one added line. With a space before the caret, it works.
Jay
2009-09-08 16:47:40
**@LFSR Consulting:** I just tried **"copy test ^[enter]test_2"** and it did work, at least for XP.
Jay
2009-09-08 16:50:44
Seems to be limited to just the first two additional lines?
Seba Illingworth
2010-07-31 02:47:56