fix(post-install): don't force Windows Terminal as the cmd-shell host
Setting DelegationConsole/DelegationTerminal to the Windows Terminal GUID made WT the console host for the cmd.exe shell. With Shell=cmd.exe and AutoRestartShell=1, closing the WT-hosted shell window breaks the cmd<->WT host handshake: Winlogon's relaunch leaves a bare grey desktop with no shell instead of a fresh cmd. Classic conhost restarts cleanly and is ~82 MB lighter (no WindowsTerminal process in the idle baseline). Comment out the four delegation reg adds (HKCU + Default hive) so the shell falls back to conhost. Kept commented (not deleted) to document the rationale.
This commit is contained in:
@@ -324,20 +324,26 @@ L 'Wallpaper removed (default background colour, HKCU)'
|
||||
# HKCU (SYSTEM context at FirstLogon)
|
||||
reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Search' /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f | Out-Null
|
||||
reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v ShowTaskViewButton /t REG_DWORD /d 0 /f | Out-Null
|
||||
reg add 'HKCU\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
reg add 'HKCU\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# DISABLED: forcing Windows Terminal as the default terminal host breaks the
|
||||
# cmd-shell. With Shell=cmd.exe + AutoRestartShell=1, when WT hosts the shell and
|
||||
# its window is closed, Winlogon's relaunch leaves a bare grey desktop with no
|
||||
# shell (the cmd<->WT host handshake breaks). Leaving these unset uses the classic
|
||||
# conhost, which restarts cleanly and is ~82 MB lighter (no WindowsTerminal proc).
|
||||
# reg add 'HKCU\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# reg add 'HKCU\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# Default hive — Administrator + any future user inherits on first interactive logon
|
||||
reg load HKU\DefaultUser2 'C:\Users\Default\NTUSER.DAT' 2>&1 | Out-Null
|
||||
reg add 'HKU\DefaultUser2\Software\Microsoft\Windows\CurrentVersion\Search' /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f | Out-Null
|
||||
reg add 'HKU\DefaultUser2\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v ShowTaskViewButton /t REG_DWORD /d 0 /f | Out-Null
|
||||
reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# DISABLED (see HKCU note above): WT-as-default-terminal breaks the cmd shell relaunch.
|
||||
# reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
|
||||
# No wallpaper (keep default background colour) for any future profile.
|
||||
# cmd /c for the empty value — see PS-5.1 empty-arg note in the HKCU block above.
|
||||
cmd /c 'reg add "HKU\DefaultUser2\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f' | Out-Null
|
||||
reg add 'HKU\DefaultUser2\Control Panel\Desktop' /v WallpaperStyle /t REG_SZ /d 0 /f | Out-Null
|
||||
reg unload HKU\DefaultUser2 2>&1 | Out-Null
|
||||
L 'Taskbar: search hidden, task view hidden, WT default terminal, no wallpaper'
|
||||
L 'Taskbar: search hidden, task view hidden, classic conhost (WT default disabled), no wallpaper'
|
||||
|
||||
# ── Wait for VMware Tools install to settle (kicked off at top) ──────────
|
||||
# Wrapper returned immediately while msiexec runs async. Poll until:
|
||||
|
||||
Reference in New Issue
Block a user