myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


search though all of c: and delete wild card

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> search though all of c: and delete wild card Page: [1]
Login
Message << Older Topic   Newer Topic >>
search though all of c: and delete wild card - 9/23/2008 2:46:05 PM   
mbinetti

 

Posts: 820
Score: 5
Joined: 4/1/2005
Status: offline
what i need to do is search from the root of c:\ and delete the directoires and all of its subfolders and files does anyone know an easy way ...
i foud this

strFolderName = "C:\Test"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(strFolderName) Then
fso.DeleteFolder strFolderName
End If
MsgBox "Done"

but i want it to search trough everything for "vectorworks* " there are different version of vecotr works out there so i need to find all vectorworks*


_____________________________

Mauricio


Post #: 1
RE: search though all of c: and delete wild card - 9/23/2008 4:51:30 PM   
jnelson993


Posts: 900
Score: 127
Joined: 2/18/2005
From: Minneapolis, MN
Status: offline
Because I'm so m@d with tha ol' skool skillz, I like to use .BAT files for that stuff.  RMDIR /Q /S is really good at axing folders and subfolders.  So you just need to use DIR to enumerate all folders on the c: drive that start with "vectorworks*" and then operate on each of them.  Something like this:

@echo off
SETLOCAL enabledelayedexpansion

FOR /F "usebackq tokens=*" %%A  IN (`dir /S /B /AD c:\vectorworks*`) DO (
   ECHO Removing folder "%%A"
   IF EXIST "%%A" rmdir /q /s "%%A"
)
exit 0




_____________________________

Number2 (John Nelson)
MyITForum - Blog
MyITForum - Forum Posts

(in reply to mbinetti)
Post #: 2
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> search though all of c: and delete wild card Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.281