on error resume next

'----------------------------------------------------------------------------------------------------------------

Const HKEY_LOCAL_MACHINE = &H80000002

Const HKEY_CURRENT_USER = &H80000001

Const HKEY_USERS = &H80000003

strComputer = "."

 

Set WShell = CreateObject( "WScript.Shell")

Set FSO = CreateObject( "Scripting.FileSystemObject")

Set WNetwork = CreateObject("WScript.Network")

 

'----------------------------------------------------------------------------------------------------------------

 

 

Set objRegistry=GetObject( "winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"

objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys

Set objReg = GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

 

'----------------------------------------------------------------------------------------------------------------

 

For Each objSubkey In arrSubkeys

                strValueName = "ProfileImagePath"

                strSubPath = strKeyPath & "\" & objSubkey

                objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue

                correct_in strValue

Next

 

 

strUserName = WNetwork.username

 

If UCase(strUserName) = "SYSTEM" Then

                string1 = "S-1-5-21"

                string2 = "Classes"

                objReg.EnumKey HKEY_USERS, "", arrsubkeys

                                For Each Subkey In arrSubKeys

                                                If InStr(1,Subkey, string1,1)And (InStr(1,Subkey, string2,1) = "0") Then

                                                                clean "HKEY_USERS\" & Subkey

                                                End If

                                Next

                Else

 

                clean "HKEY_CURRENT_USER"

End If

 

 

'----------------------------------------------------------------------------------------------------------------

 

Sub correct_in(dat_path)

 

                If FSO.FileExists(dat_path & "\ntuser.dat") Then

                                WShell.Run "cmd /c REG LOAD HKEY_USERS\Temporary_User_Reg\ """ & dat_path & "\NTUSER.DAT""", 2, True

                                clean "HKEY_USERS\Temporary_User_Reg"

                                WShell.Run "cmd /c REG UNLOAD HKEY_USERS\Temporary_User_Reg\", 2, True

                End If

 

End Sub

 

'----------------------------------------------------------------------------------------------------------------

 

Sub clean(id)

                Dim WshShell

                On Error Resume Next

                Set WshShell = CreateObject("WScript.Shell")

 

'backup1 = WshShell.RegRead (id & "\Software\Siber Systems\RoboForm")

 

WshShell.RegDelete (id & "\Software\Siber Systems\RoboForm\RootUserDataDir")

 

End Sub

'-------------------------