no_11_setup_checks_on_dynamic_update.cmd 2.2 KB

1234567891011121314151617181920212223242526
  1. @(set "0=%~f0"^)#) & powershell -nop -c iex([io.file]::ReadAllText($env:0)) & exit/b
  2. #:: double-click to run or just copy-paste into powershell - it's a standalone hybrid script
  3. #:: v3 of the toggle script hides the flashing cmd window via vbs
  4. #:: uses IFEO to attach to Virtual Disk Service Loader process running during setup, then erases appraiserres.dll
  5. #:: it must also do some ping-pong renaming of vdsldr in system32\11
  6. #:: you probably don't need to have it installed at all times - just when doing feature updates or manual setup within windows
  7. #:: hence the on off toggle just by running the script again
  8. $_Paste_in_Powershell = {
  9. $N = "Skip TPM Check on Dynamic Update"; $3 = @("' $N (c) AveYo 2021 : v3 IFEO-based with no flashing cmd window")
  10. $3+= 'C = "cmd /q AveYo /d/x/r erase /f/s/q %systemdrive%\$windows.~bt\appraiserres.dll&"'
  11. $3+= 'M = "md 11&cd 11&ren vd.exe vdsldr.exe &robocopy ""../"" ""./"" ""vdsldr.exe""&ren vdsldr.exe vd.exe&"'
  12. $3+= 'D = "start vd.exe -Embedding" : CreateObject("WScript.Shell").Run C & M & D, 0, False'
  13. $U = 'root\subscription'; $C = gwmi -Class CommandLineEventConsumer -Namespace $U -Filter "Name='$N'" -ea 0
  14. $B = gwmi -Class __FilterToConsumerBinding -Namespace $U -Filter "Filter = ""__eventfilter.name='$N'""" -ea 0
  15. $F = gwmi -Class __EventFilter -NameSpace $U -Filter "Name='$N'" -ea 0; $B,$C,$F |% {$_|rwmi -ea 0} # undo v1
  16. sp 'HKLM:\SYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 1 -type dword -force -ea 0 >''
  17. $K = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\vdsldr.exe'
  18. $V = "wscript 11.vbs //B //T:5"; $S = [environment]::SystemDirectory; if (test-path $K) {
  19. ri $K -force -ea 0 >''; del "$S\11.vbs" -force -ea 0; rmdir "$S\11" -force -re -ea 0
  20. write-host -fore 0xf -back 0xd "`n $N v3 [REMOVED] run again to install " } else {
  21. ni $K -force -ea 0 >''; sp $K Debugger $V -force -ea 0; [io.file]::WriteAllText("$S\11.vbs", $3-join"`r`n")
  22. write-host -fore 0xf -back 0x2 "`n $N v3 [INSTALLED] run again to remove " } ; timeout /t 5
  23. } ; start -verb runas powershell -args "-nop -c & {`n`n$($_Paste_in_Powershell-replace'"','\"')}"
  24. $_Press_Enter
  25. #::