Link to home
Start Free TrialLog in
Avatar of DAWR
DAWR

asked on

Conditional deletion of files in subfolders with batch script

Hi,

I want a batch script or VB Script to delete files.

it will live in a folder and look through that folders subfolders.
It will first search for .rar files, If it finds one, then it will skip that subfolder. If none are found, it then deletes all .par and .par2 files in the subfolder.
Avatar of DAWR
DAWR

ASKER

If it could delete any files with "sample" in the name then that would be a bonus.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well spotted Paul, didn't see the other comment about losing all files with sample in.
Avatar of DAWR

ASKER

Great hanks guys. thats EXACTLY what i wanted.

I did put in the PUSHD %~dp0, works exactly as i hoped.
No problem, dont forget to accept the answers.

Steve