Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Finding filenames containing double spaces.


15 Apr 2013   #1

Windows 7 32bit
 
 
Finding filenames containing double spaces.

Greetings. Noob here. Please be gentle. I searched everywhere, but can't find answer.

I have 40,000+ filenames in 1 folder and subfolders of which 140 filenames contain double spaces. I would LIKE to find/use a script to find and rename these files to replace the double spaces to just one, but would be happy just to find and list these files where I can print the listing.

Using the standard search in explorer doesn't work ... even when placing the double spaces in quotes.

Any help would be appreciated!

Thanks!

- Dale


My System SpecsSystem Spec
.

15 Apr 2013   #2

Windows 8 Core X64
 
 

Open a Elevated Command prompt.
Change to the drive and folder you want to work with.

For example: cd C:\Users\xxxxxxxx\Documents\Consulting

Type dir *" "* and press Enter. (there must be exactly two blank spaces between the double quotes)

That will list all the files with exactly two spaces in the name. If you want to create a list you can edit and work with, do this:

Type dir *" "* > 2blanks.txt and press Enter.
Type notepad 2blanks.txt and press Enter to edit the output list.
My System SpecsSystem Spec
15 Apr 2013   #3

Windows 7 32bit
 
 

Thank you for your reply. Will this also search any subfolders? There are literally thousands.

edit

I just realized that was a dumb question. Brain isn't awake yet.
Is there a way to search subfolders as well?

/edit
My System SpecsSystem Spec
.


15 Apr 2013   #4

W7 Pro SP1 64bit
 
 

Code:
dir *"  "* /s > file.txt
Is this a one time thing or do you need to rename files like this very often?

Is there one folder with lots of sub folders one level down?
top folder\sub folder1
top folder\sub folder2
top folder\sub folder3
top folder\sub folder4


Or, are there several levels of folders?
top folder\sub folder1\sub folder too
top folder\sub folder2\sub folder too
top folder\sub folder3\sub folder too


Are these files at all levels of folders?
top folder\filename1
top folder\filename2
top folder\filename3
top folder\filename4
top folder\sub folder\filename5
top folder\sub folder\filename6
top folder\sub folder\filename7
top folder\sub folder\sub folder too\filename8
top folder\sub folder\sub folder too\filename9
My System SpecsSystem Spec
15 Apr 2013   #5

Windows 7 32bit
 
 

Hello. This is just a one-time thing. I found and fixed the program that was causing the issue.

Thank you. It appears that this is just what I needed!

- Dale
My System SpecsSystem Spec
15 Apr 2013   #6

W7 Pro SP1 64bit
 
 

Glad to hear it.

Once you are sure - please mark the thread as solved.

And for those that might run across this thread someday...
...the "/b" switch makes for a cleaner output.

Code:
dir *"  "* /s /b > file.txt
My System SpecsSystem Spec
15 Apr 2013   #7

Windows 7 32bit
 
 

I ran the command and it found and listed all 142 files of the 44,765 ... so it worked. To answer your question, there are several levels of folders.

Solved. Many thanks again!

Ran it again using the /b switch. PERFECT! :-)
My System SpecsSystem Spec
16 Apr 2013   #8

Windows 7 Ultimate Retail Box (64-bit installed) + Service Pack 1
 
 

Here's a freeware renaming tool that is excellent:

Advanced Renamer - Free download

Saved me a lot of headaches!
My System SpecsSystem Spec
Reply

 Finding filenames containing double spaces.




Thread Tools



Similar help and support threads for2: Finding filenames containing double spaces.
Thread Forum
Drive Spaces Performance & Maintenance
Underscore between spaces? Software
Great computing/technology based double double meaning jokes? Chillout Room
Merging two unallocated spaces General Discussion
Double Monitors = Double Desktop Headache! General Discussion
Merging two unallocated spaces? Hardware & Devices
How to put spaces in your Taskbar (to sort) Customization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:19 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33