Switch branches/tags
Nothing to show
Find file Copy path
7496673 Nov 6, 2017
54 lines (41 sloc) 1.97 KB
<job id="Config-DisableWindowsStoreUpdates">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
oLogging.CreateEntry "Getting crrent OS drive letter", LogTypeInfo
sSystemDrive = oEnvironment.Item("OSDISK")
oLogging.CreateEntry "Current OS drive letter is " & sSystemDrive, LogTypeInfo
oLogging.CreateEntry "About to configure offline registry settings", LogTypeInfo
oLogging.CreateEntry "Windows version applied to harddrive is" & oEnvironment.Item("IMAGEBUILD"), LogTypeInfo
Function UpdateOfflineRegistry(sSystemDrive)
oLogging.CreateEntry "Unload the offline registry file", LogTypeInfo
bFound = False
For each sDir in oFSO.GetFolder(sSystemDrive & "\").Subfolders
If oFSO.FileExists(sDir & "\system32\config\software") then
oLogging.CreateEntry "Trying to load registry file " & sDir & "\system32\config\software", LogTypeInfo
iRetVal = oUtility.RunWithHeartbeat("reg load HKLM\NewOS """ & sDir & "\system32\config\software""")
If iRetVal = SUCCESS then
bFound = True
exit for
End if
End If
If not bFound then
oLogging.CreateEntry "Unable to find the new OS registry file; Windows Store settings cannot be updated.", LogTypeError
UpdateDevicePath = Success
End If
oLogging.CreateEntry "Disable Windows Store Updates", LogTypeInfo
oShell.RegWrite "HKEY_LOCAL_MACHINE\NewOS\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate\AutoDownload", "2", "REG_DWORD"
' 2 = always off
' 4 = always on
oLogging.CreateEntry "Disable Consumer Experience", LogTypeInfo
oShell.RegWrite "HKEY_LOCAL_MACHINE\NewOS\Policies\Microsoft\Windows\CloudContent\DisableWindowsConsumerFeatures", "1", "REG_DWORD"
' 1 = Off (disabled)
' 0 = On (enabled)
oLogging.CreateEntry "Unload the offline registry file", LogTypeInfo
oShell.Run "reg unload HKLM\NewOS", 0, true
UpdateOfflineRegistry = Success
End Function