/build/static/layout/Breadcrumb_cap_w.png

lines copy

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

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


Comments

This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login
Blog

View More Blogs from sanhivi

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ