Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script to delete folder with specific name and files

Reply
 
Old 05-11-2009   #1 (permalink)
Star


 
 

Script to delete folder with specific name and files

Hi there,

I need some help, we wanted to use "deltree" in Windows XP but seems
the command has been removed.

What we were planning to do is use deltree to delete a group of
directories with given name eg.
folders;
- test123
- test234
- test345

so what we were planning to use deltree and delete all folders
including files with the command
deltree test*

but since the command isn't avilable in WinXP, I need some help with
doing in using vbscript.

For the folders we have a range of folders ;

- test123
- test234
- test345

with some files inside so what we need to do delete the folders and
files.

Can anyone give me some assistance please......

Many thanks cheers.....


My System SpecsSystem Spec
Old 05-11-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: Script to delete folder with specific name and files


"Star" <momo2804@xxxxxx> wrote in message
news:d347667e-6d75-46cb-99c8-f25e91ae769f@xxxxxx
Quote:

> Hi there,
>
> I need some help, we wanted to use "deltree" in Windows XP but seems
> the command has been removed.
>
> What we were planning to do is use deltree to delete a group of
> directories with given name eg.
> folders;
> - test123
> - test234
> - test345
>
> so what we were planning to use deltree and delete all folders
> including files with the command
> deltree test*
>
> but since the command isn't avilable in WinXP, I need some help with
> doing in using vbscript.
>
> For the folders we have a range of folders ;
>
> - test123
> - test234
> - test345
>
> with some files inside so what we need to do delete the folders and
> files.
>
> Can anyone give me some assistance please......
>
> Many thanks cheers.....
>
Simple:
for /d %a in (test*) do rd /s /q "%a"

I'm actually a little confused by your question. You say that you need some
help with vbscript yet the solution you wanted to use (deltree.exe) is a
batch file command. If you really want a VB Script solution then the thread
titled "Scanning multiple folders" posted two days ago has the exact answer
for you.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
delete temp files via script - can B added 2 startup VB Script
Script to delete specific Computer Accounts Vista General
Delete files in specific folders. PowerShell
Script to delete files on shutdown VB Script
Script to delete a specific profile on all workstations VB Script


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46