Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
walter4991
- Posts: 21
- Joined: 11 Dec 2010 10:17
#1
Post
by walter4991 » 16 Jan 2011 02:19
Hello guys, I have something to ask:
how do I write the symbol ">" in a batch file, for example:
The command in the file bat write only
, then how do I write ">nul" ???
Thank's...
-
amel27
- Expert
- Posts: 177
- Joined: 04 Jun 2010 20:05
- Location: Russia
#2
Post
by amel27 » 16 Jan 2011 04:14
-
walter4991
- Posts: 21
- Joined: 11 Dec 2010 10:17
#3
Post
by walter4991 » 16 Jan 2011 04:41
thanks a lot, it works ... but what does it mean "^" ???
-
amel27
- Expert
- Posts: 177
- Joined: 04 Jun 2010 20:05
- Location: Russia
#4
Post
by amel27 » 16 Jan 2011 06:10
-
jeb
- Expert
- Posts: 1055
- Joined: 30 Aug 2007 08:05
- Location: Germany, Bochum
#6
Post
by jeb » 16 Jan 2011 12:16
At the page are missing some more cases.
Code: Select all
SETLOCAL DISABLEDELAYEDEXPANSION
echo 1 ^^^^ "^^^^"
echo 2 ^^^^ "^^^^" ^^!
echo *******
SETLOCAL ENABLEDELAYEDEXPANSION
echo 3 ^^^^ "^^^^"
echo 4 ^^^^ "^^^^" ^^!
---- OUTPUT ----
1 ^^ "^^^^"
2 ^^ "^^^^" ^!
*******
3 ^^ "^^^^"
4 ^ "^^" !
As you can see, number 4 seems to be really mysterious.
To understand the escape mechanism is one of the major keys of batch files.
hope it helps
jeb