This script will Show of Hide Administrator account on Desktop. (VBScript)

'Hide or Show Administrator Account on Desktop, XP

Dim WshShell, ObjShell, m, MyBox, p, z, cm, Title, setting, error

Set WshShell = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.length = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" &_
" RunAsAdministrator", , "runas", 1
Else

Message = "Hide or Show Administrator Account on Desktop." & vbCr & vbCr
Message = Message & "Adding information can unintentionally change or delete values" & vbCr
Message = Message & "and cause components to stop working correctly." & vbCr
Message = Message & "If you do not trust the source of this information, do not add it to the registry." & vbCr & vbCr
Message = Message & "Are you sure you want to continue?"

X = MsgBox(Message, vbYesNo + vbInformation, "Paul's XP and Vista Tweaks")
If X = 6 Then

p = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\Administrator"
setting = "REG_DWORD"
z= "Choose Show or Hide."

On Error Resume Next

m = WshShell.RegRead(p)
error = Err.Number
If error <> 0 then

m = 0
End If

Title = "0 = Hide Administrator Account on Desktop." & vbCr & "1 = Show Administrator Account on Desktop." & vbCr & vbCr & vbCr & vbCr & "It Is Now Set At:"
On Error Goto 0

cm = InputBox(Title, z, m)
If cm <> "" Then
WshShell.RegWrite p, cm, setting
End If

If cm <> "" Then
MyBox = MsgBox("You must Log Off/On for this change to take effect." & vbCr & vbCr &_
"This script was downloaded from www.paulsxp.com" ,64,"Setting has Changed")
End If
End If
End If

Download


Back to Line 33