修改sysprp只能prep3次的限制
REG ADD "HKEY_LOCAL_MACHINE\System\Setup\Status\SysprepStatus" /v CleanupState /t REG_DWORD /d 2 /fREG ADD "HKEY_LOCAL_MACHINE\System\Setup\Status\SysprepStatus" /v GeneralizationState /t REG_DWORD /d 7 /f
开启远程桌面
wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1
关闭防火墙
netsh advfirewall set allprofiles state off
关闭应用商店自动更新
reg add HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /v AutoDownload /t REG_DWORD /d 2 /f
添加启动项
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v Initialize /t REG_SZ /d "C:\Initialize\Run.exe" /f
开启F8高级选项
bcdedit /set {default} bootmenupolicy legacy
关闭UAC
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
FixUEFIDetection.wsf
<job id="FixUEFIDetection"> <script language="VBScript" src="ZTIUtility.vbs"/> <script language="VBScript">' // ***************************************************************************' // ' // File: FixUEFIDetection.wsf' // ' // Version: 1.1' // ' // Author: Johan Arwidmark, @jarwidmark' // ' // ***************************************************************************oLogging.CreateEntry "Checking if running in WinPE or Full Windows", LogTypeInfooLogging.CreateEntry "OSVersion is: " & oEnvironment.Item("OSVersion"), LogTypeInfoIf oEnvironment.Item("OSVersion") = "WinPE" Then oLogging.CreateEntry "We are in WinPE, detecting firmware type from registry...", LogTypeInfo ' Getting firmware type from WinPE registry PEFirmwareType = oShell.Regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PEFirmwareType") oLogging.CreateEntry "Firmware type from WinPE registry is " & PEFirmwareType, LogTypeInfo If PEFirmwareType = "2" Then oLogging.CreateEntry "Machine is configured for UEFI, setting the IsUEFI variable to True", LogTypeInfo oEnvironment.Item("IsUEFI") = "true" Else oLogging.CreateEntry "Machine is configured for BIOS, setting the IsUEFI variable to False", LogTypeInfo oEnvironment.Item("IsUEFI") = "false" End IfElse oLogging.CreateEntry "Detecting firmware type from Full Windows", LogTypeInfo Set objShell = CreateObject("WScript.Shell") Set objExecObject = objShell.Exec("bcdedit /enum BOOTMGR") Do While Not objExecObject.StdOut.AtEndOfStream strText = objExecObject.StdOut.ReadLine() If Instr(strText, "\EFI\Microsoft\Boot\bootmgfw.efi") > 0 Then oLogging.CreateEntry "Machine is configured for UEFI, setting the IsUEFI variable to True", LogTypeInfo oEnvironment.Item("IsUEFI") = "true" Exit Do End If Loop If oEnvironment.Item("IsUEFI") = "true" Then ' All good, do nothing Else oEnvironment.Item("IsUEFI") = "false" End IfEnd If </script></job>