2
I use the command-line program 'findstr' frequently as I write software. It helps me quickly locate all the files that contain a specific string in a set of subdirectories. It is a lot faster to use 'findstr' than anything else in a lot of cases. Today I ran into an issue where I wanted to find the string ">, so I ran this command (what I considered to be a fairly typical escaped string):
findstr /sic:"\">" *
And got back this cryptic error message: "The filename, directory name, or volume label syntax is incorrect."
Changing it to:
findstr /sic:'\">' *
Works properly. Why did I need to use single quotes instead of double quotes? I've run hundreds (maybe thousands?) of findstr commands before where I've escaped double quotes inside a double quote wrapper without any issue. What makes this particular search string so different?
what OS are you using? – EBGreen – 2012-10-24T15:20:23.643
Windows 7. Plain ol' Command Prompt (i.e. no PowerShell). – CubicleSoft – 2012-10-24T15:23:06.403
I'll check it out, but why not use PS? – EBGreen – 2012-10-24T15:24:32.437
The tools of the basic Command Prompt are generally sufficient for my needs. – CubicleSoft – 2012-10-24T15:28:16.723