Not an answer to your question, but... rather than parsing the path for
spaces, could you not just wrap the path in double quotes for all paths?

Adrian
Building a database of ColdFusion errors at http://cferror.org/

-----Original Message-----
From: Don L
Sent: 08 November 2008 18:46
To: cf-talk
Subject: Rember DOS?


I'm having a hard time with some string manipulation with DOS for the last
half an hour or so including googling to no avail.

Here's the deal.
DOS/Window batch process does not like white space, hence, I need to replace
the following directories that including white space with quotes prefix and
sufix.  So,
Documents and Settings would be replaced with "Documents and Settings" etc.

REM %appdata% maybe = C:\Documents and Settings\aUser\Application Data\
REM Here's the problem area, I don't see anything wrong below
REM however, it's not working
for /f "tokens=1,2,3,4" delims=\" %%a in ("%appdata%") do set a=%%a&set
b=%%b&set c=%%c&set d=%%d
set a = "%a%"
set b = "%b%"
echo %a%
REM expect to see "C:" for var a
echo %b%
REM expect to see "Documents and Settings" for var b

Anyone?  Thanks.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314993
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to