Solved

VBScript to delete a list of files from sub directories

Posted on 2007-03-22
3
225 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 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
The viewer will learn how to count occurrences of each item in an array.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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