Topic: Logon as Admin - AutoLogin  (Read 65 times)

0 Members and 1 Guest are viewing this topic.

Logon as Admin - AutoLogin
« on: October 15, 2017, 05:32:00 PM »

bob.omb

  • Jr. Chef
  • **
  • Location: USA
  • Date Registered: Jul 2017
  • Posts: 98
For those who wish to have Administrator account auto-login (without the command window), replace your SwitchToAdmin.ini with the attached file.

It is a combination of exact(current as of 1709 -10/15/17),  SwitchToAdmin.ini, and SwitchToAdminPrepare.ini, and it bypasses SwitchToAdmin.cmd

Shortcut, Text-on-Top, and username,options will still function as usual, but countdown options will no longer work because it will automitaclly log in!  :wink:  I would love for this to be an option (checkbox) for LogonAsAdmin plugin but until then we can use this.  :great:

Shown in codebox and attached as 7z:
Code: [Select]
////////////////////////////////////////
//   Switch to Administrator Auto  //
////////////////////////////////////////

LOGS %WinDir%\System32\SwitchToAdmin.log

CALL OSInit
CALL PreShell
CALL workgroup
CALL RenameAdmin
CALL Registry
CALL Services
// KillExplorer only for Shortcuts, explorer is not loaded with Auto-Logon
//CALL KillExplorer
CALL OpenSystemMenucmd
CALL Disconnect

////////////////////////////////////////////////////////////////////////////////////////////////
_SUB OSInit


LOGO %WinDir%\web\wallpaper\Windows\img0.jpg
TEXT System configuration, Please Wait...#0xFFFFFF L59 T39 $20*
// TIPS  System configuration, Please Wait..,,1,#1

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB PreShell

// Mount media USB, ISO to drive Y: Hide Wait
EXEC !=%WinDir%\system32\MountPEmedia.exe

// Fix display screen problems and Show Desktop. Run it once before changing the screen resolution or load a graphic driver.
EXEC %SystemRoot%\system32\FixScreen.exe

//DEVI %WinDir%\inf\xxxxx.inf

// Install external drivers, load external program
LOAD Y:\PecmdExt.ini
INIT IU,3000

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB workgroup

// Join a workgroup WORKGROUP, use startnet.exe from PENetwork, to get some network support.
// We must first join the working group, otherwise Administrator can not log in
TIPS  Switch to administrator, set up workgroup......,,1,#1
EXEC != startnet.exe -wg WORKGROUP

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB RenameAdmin

// EXEC  = Wait, @background, ! Hide. ex: EXEC =WaitNoHide.cmd, EXEC @!=WaitHide.cmd, EXEC NoWaitNoHide.cmd, EXEC @!NoWaitHide.cmd
// Rename localized Administrator account to Admin
EXEC != secedit.exe /configure /db %WinDir%\security\database\unattend.sdb /cfg %WinDir%\security\templates\unattend.inf /log %WinDir%\security\logs\unattend.log

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB Registry

// Disable sihost.exe to speed up the logon. Already done at build time
//REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\EnableSIHostIntegration=#0

// Administrator user logs automatically
TIPS  Switch to an administrator, set up automatic login......,,1,#1
REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon=#1
REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName=Administrator
REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword=""
REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName=WORKGROUP

// GUEST do not need to use the login screen
REGI HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\Guest=#0

// Launch Pecmd SwitchToAdminLogon.ini after logon as As Admin
REGI HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Init=PECMD.EXE Main %WinDir%\System32\SwitchToAdminLogon.ini

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB Services

TIPS  Start the service to switch to administrator, ......,,1,#1
EXEC !=sc start gpsvc
EXEC !=sc start ProfSvc
EXEC !=sc start seclogon

EXEC !=sc start ShellHWDetection

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB KillExplorer

//TIPS  Switch to Administrator, disconnect current user......,,1,#1

// Existing current users and automatically switch to Administrator with log enabled, it will automatically execute Pecmd admin.ini
// Kill explorer is not necessary for Auto-Logon but required for Switch to Admin shortcuts
KILL Explorer
KILL *Explorer

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB OpenSystemMenucmd

// Auto-Login
EXEC !=PECMD.EXE Main %WinDir%\System32\SwitchToAdminLogon.ini

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB Disconnect

EXEC !%WinDir%\System32\tsdiscon.exe

_END
////////////////////////////////////////////////////////////////////////////////////////////////

« Last Edit: Today at 09:38:26 AM by bob.omb »

 

Powered by EzPortal