0

I have an unversioned folder "Data Files" in D:\test\prototype\AtlasTools\Transforms\SxS\src\ folder.

I need to add these folder using commandline. I used the following code to add:

for /f "usebackq tokens=2*" %i in (`svn status ^| findstr /r "^\?"`) do svn add "%i"

But it is showing error like "SxS\src\Data cannot be found. Actually my folder name is "Data Files".

How can I add a folder having space in it?

halfer
  • 19,824
  • 17
  • 99
  • 186

3 Answers3

2

Does it work if you enclose the folder name in quotes? (that's the entire pathname including the folder)

Apart from that, I tend to agree with Stephen C that spaces in folder names will, sooner or later, come back and bite you.

Community
  • 1
  • 1
pavium
  • 14,808
  • 4
  • 33
  • 50
  • 1
    Great! So when the time comes to accept an answer, you'll know what to do, won't you? ;-D – pavium Sep 15 '09 at 08:13
1

Escape the space with a backslash.

or

If you want a directory with a name that has a space in it, such as "My Files" you need include the command in " ".

rahul
  • 184,426
  • 49
  • 232
  • 263
  • how can i escape the space in for /f "usebackq tokens=2*" %i in (svn status ^| findstr /r "^\?") do svn add "%i" i am new to this type area.... –  Sep 15 '09 at 08:02
0

for /f "usebackq tokens=2*" %i in (svn status ^| findstr /r "^\?") do svn add "%i %j"

this is the solution for this...

  • Try doubling up the % so `%i` becomes `%%i`. I haven't tried this myself, but I found it here: http://stackoverflow.com/a/1073159/2085526 – nickiaconis Jun 13 '13 at 14:58