Command Prompt Renaming Files with " and ' in the file name.

T

TerranAnd

I have a folder with thousands of files with in it.

I have been trying to run various batch commands on the files within this folder, however some of these files have " and ' within their filename.

Is there some way to either eliminate the problem characters from within the command prompt from all files within the folder or a change to the syntax that I am using so that those characters dont disrupt the syntax.

Here is an example of the type of command and the types of file names within this folder.
The File names in this example are;
Test "Run 2" Set '1'.txt

Test "Run 2" Set '2'.txt
Test "Run 3" Set '1'.txt

Test "Run 3" Set '2'.txt

So if I wanted to run a command to rename these files I would use the following however because of the quotes I get syntax errors.
ren “Test "Run 2" Set '1'.txt“ “Run 2 Example 1.txt"

ren “Test "Run 2" Set '2'.txt“ “Run 2 Example 2.txt"

ren “Test "Run 3" Set '1'.txt“ “Run 3 Example 1.txt"
ren “Test "Run 3" Set '2'.txt“ “Run 3 Example 2.txt"


Is there some way in command prompt to fix this syntax? Or less desirable is there some way to mass remove problematic characters from the names of files in command prompt (or powershell)


Thanks for your Time.

Continue reading...
 
Back
Top Bottom