In a batch file, it would be as simple as:
del /s /q *errand*
This will look for and delete any file with "errand" in it without prompting, and will search all subdirectories.
Hope this helps!
:o)
Bartender_1
Main Topics
Browse All TopicsI need to write vbscript or batch job that will search an entire computer for any file containing the string "errand". So basically a computer wide search for "*errand*". Then if any file with "errand" in it is found it should be deleted. This can be written either in VBScript or a BAT job, but it needs to be able to be called as a scheduled task. Thank you in advance for your help!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you are new to regular expressions, you can use this site to test them to see if it matches what you think it does.
http://www.regular-express
(note: only works in IE)
Bartender_1,
Thanks for the tip but I am still getting an error. See what is listed on the Run line and then the result. Let me know what you think. I also tried it without the cmd, but this of course failed as well. I also changed the name, because I noticed that my search clause included the name of my bat file and I don't want this deleted. Let me know what you think. Thanks!
Business Accounts
Answer for Membership
by: luv2craftcaPosted on 2009-09-03 at 10:32:37ID: 25252917
Regular expressions (in vbscript) could be used to do this.
en-us/libr ary/ms9745 70.aspx
Take a look at
http://msdn.microsoft.com/
for some background.