DeploymentResearch / DRFiles

Sample files for the Deployment Research Blog
MIT License
358 stars 322 forks source link

Invalid root in registry key #24

Open yohn222 opened 4 years ago

yohn222 commented 4 years ago

I'm using SCCM with MDT integration, added a 'run command line' task to run this script. Initially it was failing saying 'expected Then at line [whatever]'. I threw in few Thens and it was happy, but now it fails saying.

D:_SMSTaskSequence\WDPackage\scripts\Config-DisableWindowsStoreUpdates.wsf(45, 4) WshShell.RegDelete: Invalid root in registry key "HKEY_LOCAL_MACHINE\NewOS\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate\AutoDownload".

It fails here:

If oEnvironment.Item("_SMSTSInWinPE") = "true" Then
    oShell.RegDelete "HKEY_LOCAL_MACHINE\NewOS\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate\AutoDownload"  

I cannot work this out. I get the same thing if I try and run the script on my standard Win10 box, even if I manually create the key.

Any ideas?

aimar115 commented 4 years ago

HI had same issue that the script is missing some "Then"-s and now it fails in the same place because my 1809 image does not have those registry locations. even when registry file is loaded.

aimar115 commented 4 years ago

Everyone else that has the same problem the right script is:

https://github.com/DeploymentResearch/DRFiles/blob/3f057bea79afaefb51ca3854d4132d27f697dea1/Scripts/Config-DisableWindowsStoreUpdates.wsf

RAJU2529 commented 4 years ago

actual keyworks after installing windows, we must use CMD to add those key

Reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /v "AutoDownload" /t REG_DWORD /d "4" /f

Reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent / v"DisableWindowsConsumerFeatures" /t REG_DWORD /d "0" /f

Software is key missed

aimar115 commented 4 years ago

You misunderstood, NewOS is the location where is the registry file loaded. Actually this issue is now resolved Johan already Updated the scripts and i have been using those and these work.

RAJU2529 commented 4 years ago

@aimar115 I not misunderstood. Because I have added this registry key is by mounted image of install.wim and loaded hive file, then I modified