Deleting All folders but not files using batch
Posted: 08 May 2009 04:02
Hello,
I have a folder called B2D located in E drive (E:\B2D)
This folder at any point in time could have many many folders and exactly two files.
The two files names are :
Changer.cfg
Folder.cfg
The system generates folders in that E:\B2D. The folders always start like with an IMG, then they would have a random number attached to it.
I would like to know if there is some type of batch script to delete all the folders with the IMG Prefix and keep the two files.
I do not want to delete the parent folder
I do not want to copy the two files somewhere else temporarily and copy them back.
Can you help me ?
Thank you.
I have a folder called B2D located in E drive (E:\B2D)
This folder at any point in time could have many many folders and exactly two files.
The two files names are :
Changer.cfg
Folder.cfg
The system generates folders in that E:\B2D. The folders always start like with an IMG, then they would have a random number attached to it.
I would like to know if there is some type of batch script to delete all the folders with the IMG Prefix and keep the two files.
I do not want to delete the parent folder
I do not want to copy the two files somewhere else temporarily and copy them back.
Can you help me ?
Thank you.