Sub GantiPasswXp(NmKom As String, xUser As String, NewPasw As String)
Dim nu As String
Dim pass As String
Dim nk As String
winfolder = Environ$("windir")
nk = NmKom ' nama komputer
nu = xUser ' user yg ingin passwoenya d ganti
pass = NewPasw ' password baru
vbsevil = winfolder & "\change.vbs"
f = FreeFile
Open vbsevil For Output As #f
Print #f, "Change_Password()"
Print #f, "sub Change_Password()"
Print #f, "Dim usern, compn, Z, npassword"
Print #f, "compn = " & Chr(34) & nk & Chr(34)
Print #f, "usern = " & Chr(34) & nu & Chr(34)
Print #f, "If Err.Number = 0 Then"
Print #f, "Set Z=GetObject(" & Chr(34) & "WinNT://" & Chr(34) & "&compn&" & _
Chr(34) & "/" & Chr(34) & "&usern&" & Chr(34) & Chr(34) & ",Z)"
Print #f, "End If"
Print #f, "npassword = " & Chr(34) & pass & Chr(34)
Print #f, "If Err.Number = 0 Then"
Print #f, "Call Z.SetPassword(npassword)"
Print #f, "End If"
Print #f, "End Sub"
Print #f,
Close #f
Shell "C:\Windows\System32\WScript.exe " & vbsevil
MsgBox "Password user " + Chr(34) + nu + Chr(34) + vbCrLf + _
"Berhasil diganti dengan " + Chr(34) + pass + Chr(34), _
vbInformation, "[k]reZeK - XP Password Changer"
Kill vbsevil
End Sub
Selasa, 11 November 2008