Print Story How does one deal with blank spaces in folder names in Windows?
Software
By nlscb (Fri Apr 04, 2008 at 06:28:41 AM EST) blank spaces, windows xp, dos, special characters (all tags)
Yes, I should be using UNIX/LINUX, whatever.  Unfortunately, my employer uses windows XP.  I am trying to create a batch file that will use xcopy to copy selected folders and their contents to another directory.


Unfortunately, the folder paths have blank spaces such as:


c:\folder 1\folder 2\beer


Batch files break down in this case.  Is there a special character that I can use?  I have been googling groups this all morning and getting nowhere.


Any help would be very appreciated.

< What were the skies like when you were young? | Fridays are for fun >
How does one deal with blank spaces in folder names in Windows? | 4 comments (4 topical, 0 hidden) | Trackback
Same way as in Unix by wiredog (4.00 / 3) #1 Fri Apr 04, 2008 at 06:32:04 AM EST
Put the folder name in double quotes:
xcopy "c:\folder 1\folder 2\beer" target

Earth First!
(We can strip mine the rest later.)

Quotes by blixco (4.00 / 1) #2 Fri Apr 04, 2008 at 06:50:26 AM EST
and get a copy of robocopy, which is much cooler than xcopy.
---------------------------------
"You bring the weasel, I'll bring the whiskey." - kellnerin
The others gave real answers by ucblockhead (4.00 / 1) #3 Fri Apr 04, 2008 at 08:03:14 AM EST
I'll just note that cygwin lets you use a bash shell on Windows.
---
[ucblockhead is] useless and subhuman
Your call is important to us. by MohammedNiyalSayeed (4.00 / 2) #4 Fri Apr 04, 2008 at 01:51:05 PM EST

Please stay on hold, and your question will be answered by the first available operator.


-
You can build the most elegant fountain in the world, but eventually a winged rat will be using it as a drinking bowl.
How does one deal with blank spaces in folder names in Windows? | 4 comments (4 topical, 0 hidden) | Trackback