Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Error Resume Next
- Const vbYes = 6
- Const vbYesNoQuestion = 36
- Set fso = CreateObject("scripting.filesystemobject")
- set wshShell = CreateObject("WScript.Shell")
- s = fso.getfolder(WshShell.ExpandEnvironmentStrings("%temp%")).shortpath
- If UCase(s) = UCase(fso.GetFolder(".").ShortPath) Then
- bRet = True
- Else
- bRet = (vbYes = MsgBox( "Do you really want to delete this directory and all subdirectroies?", vbYesNoQuestion ))
- End If
- If bRet Then
- Set folRoot = fso.GetFolder(".")
- For Each filItem In folRoot.Files
- If filItem.Name <> WScript.ScriptName Then
- filItem.Delete True
- End If
- Next
- For Each folItem In folRoot.SubFolders
- folItem.Delete True
- Next
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement