When working with a customer to automate the hardening process (STIG: Security Technical Implementation Guide) for IIS servers, we ran into a problem (error 0x8002801c) when we tried to run the following command in order to disable (unregister) the Scripting.FileSystemObject ComObject
C:WindowsSystem32regsvr32.exe /u scrrun.dll
The 0x8002801c error translates to TYPE_E_REGISTRYACCESS. Using Sysinternal's Process Monitor (aka procmon), we found that it was failing because of missing permissions to the following registry keys:
HKEY_CLASSES_ROOTTypeLib{420B2830-E718-11CF-893D-00A0C9054228}1.0win32
HKEY_CLASSES_ROOTScripting.FileSystemObjectCLSID
Note that adding permissions to the first key only (as suggested in Finding V-13700 @ stigviewer.com) is not enough. The command would run without errors, the validation would pass (thinking that FSO is disabled) but you could still create and use FSO objects.
So for automating the whole process, we needed to take ownership on the registry keys, add permissions to the keys, and then run the command to unregister the DLL.
This results in the following code:
HTH
Martin.