'-------------- 'Start of UAC workaround code If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 Else '-------------- 'Start of code dim WSHShell Set WSHShell = Wscript.CreateObject("WScript.Shell") dim strRegKey strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" ) strRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\" StrUser = InputBox("Please enter in username," & vbCrLf & vbCrLf & "e.g. joe.local", "Set Last logged on", "UserName") StrDomain = InputBox("Please enter in domain for logon," & vbCrLf & vbCrLf & "e.g. DOMAIN", "Set Logon Domain OR leave blank if a local user account") If StrDomain = "" then StrDomain = "." Else End If wshShell.RegWrite strRegKey & "LastLoggedOnUser", StrDomain & "\" & StrUser, "REG_SZ" WScript.Echo "Setup Completed. Please restart the computer to complete the process" '-------------- 'End of code '-------------- 'End of UAC workaround code End If