5

I want to do a recovery of files with commas in their names from the command line, ala:

wbadmin start recovery -version:10/01/2013-12:00 -itemType:File -overwite:Overwrite -quiet "-Items:C:\Path\To\File, With Comma.txt,C:\Path\To\File 2, With Comma.txt"

So there are two files:

  1. C:\Path\To\File, With Comma.txt
  2. C:\Path\To\File 2, With Comma.txt

The problem is wbadmin assumes commas separates each file, so it sees 4 files specified instead of 2. I've tried putting a \ in front of commas that are part of the file names like so:

wbadmin start recovery -version:10/01/2013-12:00 -itemType:File -overwite:Overwrite -quiet "-Items:C:\Path\To\File\, With Comma.txt,C:\Path\To\File 2\, With Comma.txt"

but it doesn't work, it just says there's a syntax error. The documentation on Technet doesn't seem to mention anything that'll help either.

OS is Windows Server 2008 R2.

A clarifying comment: I've changed the file names to be different than the actual names to be less revealing, but I also see I dumbed it down too much. The comma can occur either in the file name itself like C:\Path\To\File, With Comma.txt or in the path to the file, like: C:\Path, To\Other\File.txt.

11
  • 1
    Have you tried changing C:\Path\To\File, With Comma.txt to "C:\Path\To\File, With Comma.txt"? Normally in command line syntax you can use double quotes to prevent the command from assuming it is the next parameter.
    – TheCleaner
    Oct 23, 2013 at 14:42
  • @TheCleaner - You beat me to it...
    – joeqwerty
    Oct 23, 2013 at 14:44
  • Originally, I did wrap the entire "-Items:..." command like that because of the spaces in the name. Changing it to -Items:"C:\Path\To\File, With Comma.txt","C:\Path\To\File 2, With Comma.txt" doesn't work either. If I specify one file, the error says the files aren't in the same directory. If I specify both files, it just says syntax error.
    – dlp
    Oct 23, 2013 at 14:57
  • same for C:\Path\To\"File, With Comma.txt"? Is it the same files each time for you? I ask because I would think you could use the 8.3 shortname instead.
    – TheCleaner
    Oct 23, 2013 at 15:18
  • Nope. If you're not careful, you do weird things on the command line from that. C:\Path\To\"File, With Comma.txt" shows up in the program as C:\Path\To\"File, With Comma.txt as if the quote was in the name because of escaped characters in the command prompt. To do what you're saying, it's really C:\Path\To\\"File.txt" but that still bombs out saying they need to be in the same directory.
    – dlp
    Oct 23, 2013 at 15:22

0

You must log in to answer this question.

Browse other questions tagged .