Skip to content

Commit

Permalink
improve SwitchToAdmin for 20H1
Browse files Browse the repository at this point in the history
  • Loading branch information
slore committed Apr 29, 2019
1 parent a9e5cec commit dc587a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Projects/WIN10XPE/00-Configures/System/Admin/Admin18850+.bat
@@ -0,0 +1,6 @@
@echo off
for /f "delims=." %%s in ('reg query "HKLM\SECURITY\SAM\Domains\Builtin\Aliases\Members"') do set AdminSID=%%s-500
set "AdminSID=%AdminSID:HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Builtin\Aliases\Members\=%"
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileService\References\%AdminSID%" /v RefCount /t REG_BINARY /d 02000000 /f
LSAgetRights.exe -c
reg load "HKU\%AdminSID%" X:\Users\Administrator\NTUSER.DAT
Expand Up @@ -64,8 +64,9 @@ if not exist "%X_SYS%\tsdiscon.exe" (

expand Security.cab -F:* "%X_WIN%\Security"

if %VER[3]% GTR 18800 (
if %VER[3]% GTR 18850 (
copy /y LSAgetRights_%WB_PE_ARCH%.exe "%X_SYS%\LSAgetRights.exe"
copy /y "Admin18850+.bat" "%X_SYS%\"
)

rem use in :PECMD_ENTRY@last.bat
Expand Down
2 changes: 0 additions & 2 deletions Projects/WIN10XPE/_CustomFiles_/Pecmd.ini
Expand Up @@ -95,8 +95,6 @@ _SUB LoadShell

IFEX %WinDir%\System32\ctfmon.exe, EXEC %WinDir%\System32\ctfmon.exe

IFEX %WinDir%\System32\LSAgetRights.exe, EXEC !=LSAgetRights.exe -c

//EXP_SHEL %WinDir%\explorer.exe
//WXS_SHEL %ProgramFiles%\WinXShell\WinXShell.exe -regist -winpe
//EXP_EXEC !%ProgramFiles%\WinXShell\WinXShell.exe -regist -daemon
Expand Down
1 change: 1 addition & 0 deletions Projects/WIN10XPE/_CustomFiles_/PecmdAdmin.ini
Expand Up @@ -44,6 +44,7 @@ EXEC != secedit.exe /configure /db %WinDir%\security\database\unattend.sdb /cfg
CALL $Netapi32.dll,NetJoinDomain,,WORKGROUP,,,,1

EXEC !=SC start seclogon
IFEX %WinDir%\System32\Admin18850+.bat, EXEC =Admin18850+.bat
EXEC !%WinDir%\System32\tsdiscon.exe

_END
Expand Down

0 comments on commit dc587a5

Please sign in to comment.