Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub onLoad()
- window.ResizeTo 150,80
- const HKEY_CURRENT_USER = &H80000001
- strComputer = "."
- Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
- ' Delete Policies registry key
- strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policies"
- DeleteSubkeys HKEY_CURRENT_USER, strKeyPath, objReg
- ' Remove IE restrictions
- strKeyPath = "Software\Policies\Microsoft\Internet Explorer"
- DeleteSubkeys HKEY_CURRENT_USER, strKeyPath, objReg
- ' Enable Command Prompt
- objReg.SetDWORDValue HKEY_CURRENT_USER, "Software\Policies\Microsoft\Windows\System", "DisableCMD", 0
- ' Kill Explorer.exe
- Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
- Set colProcessList = objWMIService.ExecQuery _
- ("Select * from Win32_Process Where Name = 'explorer.exe'")
- For Each objProcess in colProcessList
- objProcess.Terminate(1)
- Next
- ' Launch Explorer.exe
- Set objShell = CreateObject("Wscript.Shell")
- objShell.Run "explorer.exe"
- Set objShell = Nothing
- document.parentWindow.setTimeout "CloseMe()", 3000
- End Sub
- ' Recursively delete registry keys
- Sub DeleteSubkeys(HKEY_CURRENT_USER, strKeyPath, objRegistry)
- objRegistry.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubkeys
- If IsArray(arrSubkeys) Then
- For Each strSubkey In arrSubkeys
- DeleteSubkeys HKEY_CURRENT_USER, strKeyPath & "\" & strSubkey, objRegistry
- Next
- End If
- objRegistry.DeleteKey HKEY_CURRENT_USER, strKeyPath
- End Sub
- ' Close the window
- Sub CloseMe()
- close
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement