Windows 7 explorer search confusion

x509

2[H]4U
Joined
Sep 20, 2009
Messages
2,630
The background: using some third-party sync tools to sync up my DATA partition between my desktop and my laptop, a LOT :eek: :eek: :mad: of files on my laptop were duplicated instead of being updated or simply copied over.

So if I had a file on my desktop named:

Client Report.pdf

On my laptop I ended up with:

Client Report.pdf
Client Report.1.pdf

So you would figure, OK, I just do a scan on ".1.pdf" on my system,and that would allow me to do a mass-delete of the duplicated drives, no matter what the folder.

The situation:

But you would be wrong. The Windows search would pick up files like:

Client Report 11-02.pdf

while ignoring many legit files. Also, if the search string was contained as data inside a text file (like, typically a web page), I got those files listed.

I can do a stupid-simple search like this in the command window:

dir /s *.1.pdf

and get all the problem files listed. Problem is that I would have to go manually to each folder to delete the offending files.

The solution:

I don't know. That's why I'm posting this thread. I love [H] because there are so many smart people on this forum.

Forgot to mention earlier. Win 7 64 Pro, on both desktop and laptop systems.

Thanks, guys.
 
if "dir /s *.1.pdf" is giving you the list you need, use dir to build a delete list.

1. Make a notepad file called filelist.bat in the root of the directory you want to search, and put in it "dir /s /b *.1.pdf >Filelist.txt" The /b command ("bare") will give you the list of files without all that other stuff like sizes and what not.
2. Close the file and double click on it.
3. Open the results file : filelist.txt, and since the command to delete files is very basic, just use find and replace to make the lines look like :

del "C:\WhateverFolder\Whateverfile.1.pdf"

4. Save this as delete.bat.

5. double click on delete.bat
 
if "dir /s *.1.pdf" is giving you the list you need, use dir to build a delete list.

1. Make a notepad file called filelist.bat in the root of the directory you want to search, and put in it "dir /s /b *.1.pdf >Filelist.txt" The /b command ("bare") will give you the list of files without all that other stuff like sizes and what not.
2. Close the file and double click on it.
3. Open the results file : filelist.txt, and since the command to delete files is very basic, just use find and replace to make the lines look like :

del "C:\WhateverFolder\Whateverfile.1.pdf"

4. Save this as delete.bat.

5. double click on delete.bat

Thanks. I don't know why I didn't think of this myself. :rolleyes:
 
Back
Top