Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strUserFolder = LCase(CreateObject("WScript.Shell").ExpandEnvironmentStrings("%userprofile%"))
- Do
- For Each objShellWindow In CreateObject("Shell.Application").Windows
- Set objDocument = objShellWindow.Document
- If InStr(TypeName(objDocument), "IShellFolderViewDual") Then
- strPath = LCase(objDocument.Folder.Self.Path)
- Select Case True
- Case strPath = "::{20d04fe0-3aea-1069-a2d8-08002b30309d}"
- Case strPath = "c:\"
- Case InStr(strPath, "d:\") > 0
- Case InStr(strPath, strUserFolder) > 0
- Case Else
- objShellWindow.Quit
- End Select
- End If
- Next
- Wscript.Sleep 100
- Loop
Add Comment
Please, Sign In to add comment