How do I create wildcards for folder names for mass deleting a folder located under each users profile?

There is a folder that I want to delete that is located under each users profile folder on our server it looks something like this \\server\"insert users name here"\Application Data\Microsoft\Internet Explorer. I would like to know how I could go about creating a batch file that would allow me to put in a wildcard where the users name is so that no matter what the users folder name is it will just go in and find the folder \Internet Explorer and delete it for all 250 so users.
kjcceeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

forrestoffCommented:
this may help, and if you choose, you could type it into the command prompt but you'd have to change all the %%i's to %i.

The command enumerates the directory structure of users in \\server\ and will remove, recursively, the directory "Internet Explorer" found within the path.
for /f "usebackq" %%i in (`dir/b \\server\`) do rmdir /s /q "\\server\%%i\Application Data\Microsoft\Internet Explorer"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kjcceeAuthor Commented:
That worked perfectly thank you
0
kjcceeAuthor Commented:
That worked perfectly thank you
0
forrestoffCommented:
You're welcome! :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.