Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
milanka
- Posts: 2
- Joined: 06 May 2010 11:12
#1
Post
by milanka » 06 May 2010 11:21
runme.bat:
i start this:
runme.bat echo all ^|
and error at echo with | character
i want this output:
echo all |
and run app.exe with echo all | switches(here maybe %switches:^|=^^^|% ?)
and && too not works, so i want echo the raw text
please help
(and sorry for my bad "english"
)
-
jeb
- Expert
- Posts: 1055
- Joined: 30 Aug 2007 08:05
- Location: Germany, Bochum
#2
Post
by jeb » 06 May 2010 12:57
Hi milanka,
you are on the right path (replace the characters).
runme.bat:
Code: Select all
@echo off
set "var=%*"
set "var=%var:|=^|%
set "var=%var:&=^&%
echo %var%
Code: Select all
runme.bat echo all ^|
RESULT:
echo all |
jeb
-
milanka
- Posts: 2
- Joined: 06 May 2010 11:12
#3
Post
by milanka » 06 May 2010 13:18
thanks jeb, working
but when i don't give parameters for batch, then don't
solved: if DEFINED var ...
-
avery_larry
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
#4
Post
by avery_larry » 12 May 2010 11:10
could also do:
@echo %~1
and then:
runme "echo all ^|"