?
Solved

VBScript to delete a list of files from sub directories

Posted on 2007-03-22
3
Medium Priority
?
230 Views
Last Modified: 2010-04-16
I need a VBScript to delete a list of paths and files from the current directory. The list of files is located on C:\files.txt. The current can be any directory. Every file in the list is in a sub directory of the current directory: File example:

copenhagen/hotels/images/4.jpg
copenhagen/hotels/images/6.jpg
copenhagen/hotels/images/7.jpg
copenhagen/hotels/images/8.jpg
copenhagen/hotels/images/9.jpg
copenhagen/hotels/images/breakfast_room_icon.gif
copenhagen/hotels/images/index_clip_image002.jpg
copenhagen/hotels/images/index_clip_image003.jpg
copenhagen/hotels/images/index_clip_image004.jpg
copenhagen/hotels/images/index_clip_image006.gif
copenhagen/hotels/images/index_clip_image006_0000.gif
copenhagen/hotels/images/index_clip_image006_0001.gif
copenhagen/hotels/images/index_clip_image006_0002.gif
copenhagen/hotels/images/index_clip_image006_0003.gif
copenhagen/hotels/images/index_clip_image006_0004.gif
copenhagen/hotels/images/index_clip_image006_0005.gif
copenhagen/hotels/images/index_clip_image007.gif
copenhagen/hotels/images/index_clip_image007_0000.gif
copenhagen/hotels/images/index_clip_image007_0001.gif
copenhagen/hotels/images/index_clip_image007_0002.gif
copenhagen/hotels/images/index_clip_image007_0003.gif
copenhagen/hotels/images/index_clip_image007_0004.gif
copenhagen/hotels/images/index_clip_image007_0005.gif
copenhagen/hotels/images/index_clip_image007_0006.gif
copenhagen/hotels/images/index_clip_image008.gif
copenhagen/hotels/images/index_clip_image008_0000.gif
copenhagen/hotels/images/index_clip_image008_0001.gif
copenhagen/hotels/images/index_clip_image008_0002.gif
copenhagen/hotels/images/index_clip_image008_0003.gif
copenhagen/hotels/images/index_clip_image008_0004.gif
copenhagen/hotels/images/index_clip_image008_0005.gif
copenhagen/hotels/images/index_clip_image010.jpg
copenhagen/hotels/images/index_clip_image011.jpg
copenhagen/hotels/images/index_clip_image012.jpg
copenhagen/hotels/images/index_clip_image013.gif
copenhagen/hotels/images/index_clip_image013_0000.gif
copenhagen/hotels/images/index_clip_image013_0001.gif
copenhagen/hotels/images/index_clip_image013_0002.gif
copenhagen/hotels/images/index_clip_image014.gif
copenhagen/hotels/images/index_clip_image014_0000.gif
copenhagen/hotels/images/index_clip_image014_0001.gif
copenhagen/hotels/images/index_clip_image014_0002.gif
copenhagen/hotels/images/index_clip_image016.jpg
copenhagen/hotels/images/index_clip_image017.jpg
copenhagen/hotels/images/index_clip_image018.jpg
copenhagen/hotels/images/index_clip_image019.gif
copenhagen/hotels/images/index_clip_image020.jpg
copenhagen/hotels/images/index_clip_image021.jpg
copenhagen/hotels/images/index_clip_image022.jpg
copenhagen/hotels/images/index_clip_image023.jpg
copenhagen/hotels/images/index_clip_image025.jpg
copenhagen/hotels/images/index_clip_image026.jpg
copenhagen/hotels/images/index_clip_image027.jpg
copenhagen/hotels/images/index_clip_image029.jpg
copenhagen/hotels/images/index_clip_image030.jpg
copenhagen/hotels/images/index_clip_image031.jpg
copenhagen/hotels/images/index_clip_image032.gif
copenhagen/hotels/images/index_clip_image034.jpg
copenhagen/hotels/images/index_clip_image035.jpg
copenhagen/hotels/images/index_clip_image036.jpg
copenhagen/hotels/images/index_clip_image037.gif
copenhagen/hotels/images/index_clip_image037_0000.gif
copenhagen/hotels/images/index_clip_image039.jpg
copenhagen/hotels/images/index_clip_image040.jpg
copenhagen/hotels/images/index_clip_image041.jpg
copenhagen/hotels/images/lift_icon.gif

Yes I am deleting certain orphaned files from a website :-D

Thanks,

Lee.
0
Comment
Question by:LeeGolding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 2000 total points
ID: 18770299

Just curious... but can't you just throw those all in a batch file, get to the directory above copenhagen and off you go?

It just seems like overkill writing it into VbScript.

Chris
0
 

Author Comment

by:LeeGolding
ID: 18850301
Yes I didn't see that. Doh!

Thanks :-D

Lee.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 18850334

No problem :)

Chris
0

Featured Post

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question