I have small disk space on one partition. In one folder there is lot of folders and sub-folders which sometimes contain a lot of files of these extensions:
*.ilk, *.pdb, *.exp , I would like to delete these files but not to do it manually because that can be dangerous (I could simply delete other files which should not be touched). What is the safe way how delete these files in subfolders? Also placing bat file to every folder is not good idea because I create new directories and that would be complicated.
How to delete file using deep search in Windows XP?
Moderator: DosItHelp
Re: How to delete file using deep search in Windows XP?
Copying, moving, deleting files is easy with Robocopy, its included with OS and accessible from a batch. In Cmd window type robocopy /? to see available options for your OS version. In Win10 there's '/IF :: Include the following files' option, where you can list *.ilk, *.pdb, *.exp, but /IF isn't strictly required. See more Robocopy config examples here.
Your above batch may look like this to check all multilevel folders under My_Folder for target files, move the files and their empty folders (if any) to Deleted folder, then delete that folder (don't try moving to Recycled Bin):
Your above batch may look like this to check all multilevel folders under My_Folder for target files, move the files and their empty folders (if any) to Deleted folder, then delete that folder (don't try moving to Recycled Bin):
Code: Select all
@echo off
setlocal
set "source=K:\My_Folder" & set "dest=K:\Deleted" & set "log=K:\My_Folder\RoboLog.txt"
set "options=/R:3 /W:20 /LOG+:%log% /NFL /NDL"
set "what=/COPYALL /B /TEE /MAXAGE:7 /S /MOVE *.ilk, *.pdb, *.exp"
robocopy %source% %dest% %what% %options%
if exist %dest% (rd /s /q %dest%)
endlocal
exit /b
Re: How to delete file using deep search in Windows XP?
Make sure that "d:\folder" is correct and it exists.
Code: Select all
cd /d "d:\folder"
del /s *.ilk *.pdb *.exp
Re: How to delete file using deep search in Windows XP?
On Windows XP I cannot find the program. robocopy /? command does not exist.
RE: Foxidrive: That sounds quite easy. Thanks
It works like sharm:
I place it to folder where and which subfolders I need to clear.
RE: Foxidrive: That sounds quite easy. Thanks
It works like sharm:
Code: Select all
@cls
cd /d ".\"
del /s *.ilk *.pdb *.exp
pause
I place it to folder where and which subfolders I need to clear.
Re: How to delete file using deep search in Windows XP?
Robocopy for XP is part of this Resource Kit. I prefer using it since it allows various file ops in a single batch when called as a function.