Re: Any way to escape parenthesis characters in a batch file?
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 28 Mar 2008 07:01:12 +0100
"Big Al" <BigAl@xxxxxxxxxxx> wrote in message
news:JLWGj.9189$Oj5.1280@xxxxxxxxxxx
WB wrote:
if "%PROCESSOR_ARCHITECTURE%"=="x86" (I didn't think .bat files would accept if/else commands.
set PROGNAME=Program Files
) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
set PROGNAME=Program Files (x86)
)
This fails because of the parenthesis in (x86). I have a workaround
already, but I'd prefer using the method above for readability. Any way
to escape the parenthesis characters so this will work?
I know 'if exists ... goto' works. I use it to skip to another line in a
batch file, and thus the next line is the else.
But not much else you can do.
They actually do. Try this for fun:
@echo off
if %UserName%==Al (echo Hello Al) else (echo Goodby %Username%)
.
- Follow-Ups:
- References:
- Prev by Date: Re: BSOD
- Next by Date: Re: Any way to escape parenthesis characters in a batch file?
- Previous by thread: Re: Any way to escape parenthesis characters in a batch file?
- Next by thread: Re: Any way to escape parenthesis characters in a batch file?
- Index(es):
Relevant Pages
|