Guest User

Untitled

a guest
Nov 18th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. @echo off
  2. :: // ***************************************************************************
  3. :: //
  4. :: // Copyright (c) Microsoft Corporation. All rights reserved.
  5. :: //
  6. :: // Microsoft Deployment Toolkit Solution Accelerator
  7. :: //
  8. :: // File: SetupComplete.cmd
  9. :: //
  10. :: // Version: 6.3.8447.1000
  11. :: //
  12. :: // Purpose: Called after a successful in-place upgrade. This batch file
  13. :: // sets itself to re-run after reboots, and then calls
  14. :: // LTIBootstrap.vbs to run the task sequence. If the task
  15. :: // sequence doesn't initiate a reboot (indicating that the
  16. :: // task sequence is done), the batch file will continue and
  17. :: // clean itself from the registry.
  18. :: //
  19. :: // ***************************************************************************
  20.  
  21. :: Workaround for incorrectly-registered TS environment
  22. reg delete HKCR\Microsoft.SMS.TSEnvironment /f
  23.  
  24. for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%d:\Windows\Setup\Scripts\setupcomplete.cmd (
  25. reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v Win10UpgradeStatusCode /t REG_SZ /d "Success" /f
  26. reg add "HKEY_LOCAL_MACHINE\SYSTEM\Setup" /v SetupType /t REG_DWORD /d 2 /f
  27. reg add "HKEY_LOCAL_MACHINE\SYSTEM\Setup" /v CmdLine /t REG_SZ /d "%%d:\Windows\Setup\Scripts\setupcomplete.cmd" /f
  28. echo %DATE%-%TIME% Registered Setupcomplete.cmd in registry >> %%d:\MININT\SMSOSD\OSDLOGS\setupcomplete.log)
  29.  
  30. for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%d:\MININT\Scripts\LTIBootstrap.vbs (wscript.exe %%d:\MININT\Scripts\LTIBootstrap.vbs )
  31.  
  32. echo %DATE%-%TIME% Successfully upgraded windows, resetting registry >> %WINDIR%\CCM\Logs\setupcomplete.log
  33. reg add "HKEY_LOCAL_MACHINE\SYSTEM\Setup" /v SetupType /t REG_DWORD /d 0 /f
  34. reg add "HKEY_LOCAL_MACHINE\SYSTEM\Setup" /v CmdLine /t REG_SZ /d "" /f
  35. for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%:\Windows\Setup\Scripts\setupcomplete.cmd (
  36. echo %DATE%-%TIME% Exiting SetupComplete.cmd >> %%d:\MININT\SMSOSD\OSDLOGS\setupcomplete.log)
Add Comment
Please, Sign In to add comment