修改sysprp只能prep3次的限制

  1. REG ADD "HKEY_LOCAL_MACHINE\System\Setup\Status\SysprepStatus" /v CleanupState /t REG_DWORD /d 2 /f
  2. REG ADD "HKEY_LOCAL_MACHINE\System\Setup\Status\SysprepStatus" /v GeneralizationState /t REG_DWORD /d 7 /f

开启远程桌面

  1. wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1

关闭防火墙

  1. netsh advfirewall set allprofiles state off

关闭应用商店自动更新

  1. reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /v AutoDownload /t REG_DWORD /d 2 /f

添加启动项

  1. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v Initialize /t REG_SZ /d "C:\Initialize\Run.exe" /f

开启F8高级选项

  1. bcdedit /set {default} bootmenupolicy legacy

关闭UAC

  1. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f

FixUEFIDetection.wsf

  1. <job id="FixUEFIDetection">
  2. <script language="VBScript" src="ZTIUtility.vbs"/>
  3. <script language="VBScript">
  4. ' // ***************************************************************************
  5. ' //
  6. ' // File: FixUEFIDetection.wsf
  7. ' //
  8. ' // Version: 1.1
  9. ' //
  10. ' // Author: Johan Arwidmark, @jarwidmark
  11. ' //
  12. ' // ***************************************************************************
  13. oLogging.CreateEntry "Checking if running in WinPE or Full Windows", LogTypeInfo
  14. oLogging.CreateEntry "OSVersion is: " & oEnvironment.Item("OSVersion"), LogTypeInfo
  15. If oEnvironment.Item("OSVersion") = "WinPE" Then
  16. oLogging.CreateEntry "We are in WinPE, detecting firmware type from registry...", LogTypeInfo
  17. ' Getting firmware type from WinPE registry
  18. PEFirmwareType = oShell.Regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PEFirmwareType")
  19. oLogging.CreateEntry "Firmware type from WinPE registry is " & PEFirmwareType, LogTypeInfo
  20. If PEFirmwareType = "2" Then
  21. oLogging.CreateEntry "Machine is configured for UEFI, setting the IsUEFI variable to True", LogTypeInfo
  22. oEnvironment.Item("IsUEFI") = "true"
  23. Else
  24. oLogging.CreateEntry "Machine is configured for BIOS, setting the IsUEFI variable to False", LogTypeInfo
  25. oEnvironment.Item("IsUEFI") = "false"
  26. End If
  27. Else
  28. oLogging.CreateEntry "Detecting firmware type from Full Windows", LogTypeInfo
  29. Set objShell = CreateObject("WScript.Shell")
  30. Set objExecObject = objShell.Exec("bcdedit /enum BOOTMGR")
  31. Do While Not objExecObject.StdOut.AtEndOfStream
  32. strText = objExecObject.StdOut.ReadLine()
  33. If Instr(strText, "\EFI\Microsoft\Boot\bootmgfw.efi") > 0 Then
  34. oLogging.CreateEntry "Machine is configured for UEFI, setting the IsUEFI variable to True", LogTypeInfo
  35. oEnvironment.Item("IsUEFI") = "true"
  36. Exit Do
  37. End If
  38. Loop
  39. If oEnvironment.Item("IsUEFI") = "true" Then
  40. ' All good, do nothing
  41. Else
  42. oEnvironment.Item("IsUEFI") = "false"
  43. End If
  44. End If
  45. </script>
  46. </job>