Monday, April 2, 2007

Delete Windows Patch Install Folders

Const WINDOWS = &H24&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(WINDOWS)
Set objFolderItem = objFolder.Self
' Wscript.Echo objFolderItem.Path

Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder(objFolderItem.Path)

Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
If Right(Subfolder.Name,1) = "$" AND Left(Subfolder.Name,1) = "$" Then
' Wscript.Echo Subfolder.Name
Subfolder.Delete
End If
' Wscript.Echo Subfolder.Path
' ShowSubFolders Subfolder
Next
End Sub

No comments:

Related Titles

 
visitors since March 26 2007
©2007