Deleting files using VBscript

J

Jerry

Does anyone know where I can find a VBscript that will delete files?
I'm not interested in learning the VBscript language.
 
T

Torgeir Bakken \(MVP\)

Jerry said:
Does anyone know where I can find a VBscript that will delete files?
I'm not interested in learning the VBscript language.
Hi

You will find a lot of examples here:
http://groups.google.com/groups?as_...roup=*.scripting&as_drrb=q&as_qdr=y&lr=&hl=en

Note that if you want to delete files from a file collection returned
from the File System Object, you should *never* do this when still
looping through the collection. The collection may get mixed up with
unpredictable results. Create an array of the file paths first to
avoid this.

In the article below there is a WSH script (vbscript) by Michael
Harris that deletes files x days old in a specific folder (and
optionally all subfolders), using an array of the file paths.

Newsgroups: microsoft.public.scripting.wsh
Date: 2002-10-07 08:12:33 PST
http://groups.google.com/[email protected]


WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:

http://msdn.microsoft.com/downloads/list/webdev.asp
 
J

Jerry

Thanks ... I found one that works.

Hi

You will find a lot of examples here:
http://groups.google.com/groups?as_...roup=*.scripting&as_drrb=q&as_qdr=y&lr=&hl=en

Note that if you want to delete files from a file collection returned
from the File System Object, you should *never* do this when still
looping through the collection. The collection may get mixed up with
unpredictable results. Create an array of the file paths first to
avoid this.

In the article below there is a WSH script (vbscript) by Michael
Harris that deletes files x days old in a specific folder (and
optionally all subfolders), using an array of the file paths.

Newsgroups: microsoft.public.scripting.wsh
Date: 2002-10-07 08:12:33 PST
http://groups.google.com/[email protected]


WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:

http://msdn.microsoft.com/downloads/list/webdev.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top