I’m trying to delete statically set KMS server names in the Windows registry on our computers. I’ve never had an issue deleting registry entries, but it seems every method I attempt to use for deleting the entries simply doesn’t work in the fixlet. Sorry if this is a little long, I’ve tried to give the essentials of what I’ve done.
I’ve tried:
1. This method (which I’ve used in past fixlets): http://www-01.ibm.com/support/docview.wss?uid=swg21506061
Action Script:
delete __appendfile
delete regdel.reg
appendfile REGEDIT4
appendfile [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform]
appendfile “KeyManagementServiceName”=-
appendfile [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform]
appendfile “KeyManagementServiceName”=-
move __appendfile regdel.reg
wait regedit /s regdel.reg
waithidden cmd.exe /c cscript c:\Windows\System32\slmgr.vbs /ckms
After lots of tweaking (trying dos, etc) I still couldn’t get this to work. Even though the cscript slmgr.vbs command would work at the end successfully, the registry entries would not delete.
2. Next I tried using a .reg and a .cmd:
%~d0
cd %~dp0
regedit /s delete_kms_names.reg
cscript c:\Windows\System32\slmgr.vbs /ckms
and the reg file (delete_kms_names.reg):
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform]
“KeyManagementServiceName”=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform]
“KeyManagementServiceName”=-
Clicking the batch script on the computer would delete the registry entries no problem, but as a fixlet it would not work (just used a generated actionscript through software distribution). It runs the cscript slmgr.vbs command, but the registry entries aren’t deleted.
3. Finally, I tried using REG DELETE command instead of regedit /s and a .reg file. This is what the cmd batch script looks like:
REG DELETE “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform” /v KeyManagementServiceName /f
REG DELETE “HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform” /v KeyManagementServiceName /f
cscript c:\Windows\System32\slmgr.vbs /ckms
Once again, clicking the cmd on the computer and the reg entries disappear (with a ‘successfully deleted’ message), but as a fixlet it fails to delete the entries and only runs the cscript slmgr.vbs command. Interestingly, converting this method to an actionscript and redirecting the output to a log file, the log file shows the REG DELETE commands running, but there is no ‘success’ or ‘failure’ message or output of any kind like there is when the cmd is clicked. Of course, the cscript slmgr.vbs command always works (with the same output as clicking the cmd), just the attempts to delete the registry entries fail. For reference, here is what the actionscript looks like:
waithidden cmd.exe /c REG DELETE “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform” /v KeyManagementServiceName /f > C:\kms.log
waithidden cmd.exe /c REG DELETE “HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform” /v KeyManagementServiceName /f >> c:\kms.log
// Clear the server and set to auto-discovery through DNS
waithidden cmd.exe /c cscript c:\Windows\System32\slmgr.vbs /ckms >> C:\kms.log
We are currently utilizing all of these methods to create and delete registry entries in working fixlets in our environment, so I’m at a loss to explain how this situation is different and why running these commands through BigFix have no effect.
Any help or insight would be greatly appreciated.