PC Review


Reply
Thread Tools Rate Thread

changing PATH with bracket

 
 
Kok Yong Lee
Guest
Posts: n/a
 
      6th Feb 2007
Hi there,

I have a batch file need to modify the env path according to a keyword
supplied by user during run time to change the PATH; e.g. mybat debug, mybat
optimize.

However on certain machine, especially x64 machine, the bracket in the PATH
has caused me a lot of grief.

for example in the code snippet below, if I run it it always error out as
"\fred was unexpected at this time.".

Just wodered are there any ways to get around the bracket issue?

thanks.


snippet
----------------
set path=c:\program files(x68)\fred;%PATH%
if /i .%1 == .optimize (
set path=optimize;%PATH%
)





 
Reply With Quote
 
 
 
 
foxidrive
Guest
Posts: n/a
 
      6th Feb 2007
On Tue, 6 Feb 2007 11:26:13 -0000, "Kok Yong Lee" <(E-Mail Removed)>
wrote:

>Hi there,
>
>I have a batch file need to modify the env path according to a keyword
>supplied by user during run time to change the PATH; e.g. mybat debug, mybat
>optimize.
>
>However on certain machine, especially x64 machine, the bracket in the PATH
>has caused me a lot of grief.
>
>for example in the code snippet below, if I run it it always error out as
>"\fred was unexpected at this time.".
>
>Just wodered are there any ways to get around the bracket issue?
>
>thanks.
>
>
>snippet
>----------------
>set path=c:\program files(x68)\fred;%PATH%
>if /i .%1 == .optimize (
> set path=optimize;%PATH%
>)


Ditch the parenthesis:

@echo off
set path=c:\program files^(x68^)\fred;%PATH%
if /i .%1 == .optimize set path=optimize;%PATH%
echo %path%
 
Reply With Quote
 
Kok Yong Lee
Guest
Posts: n/a
 
      7th Feb 2007
many thanks.

>
> Ditch the parenthesis:
>
> @echo off
> set path=c:\program files^(x68^)\fred;%PATH%
> if /i .%1 == .optimize set path=optimize;%PATH%
> echo %path%



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing path =?Utf-8?B?amFtaWU=?= Windows XP New Users 2 15th Feb 2005 03:41 PM
Changing Path 101ONTLTD Microsoft Access Form Coding 2 25th May 2004 04:33 PM
Changing path Jim Slager Windows XP General 2 7th Feb 2004 05:41 AM
Changing the Path Steve Windows XP Setup 1 7th Jan 2004 10:41 PM
Difficulty in changing the Connection Server control path changing ... Samridhi Kumar Shukla Microsoft ASP .NET 1 30th Nov 2003 02:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:07 AM.