
Necesitamos eliminar un valor de seguridad de la clave de registro de la unidad de CD-ROM. La ubicación principal es HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE. A partir de ahí, dependerá de la marca y modelo de la unidad de CD, pero debería haber un valor de Seguridad que debe eliminarse. Encontré el siguiente código VBS pero no parece funcionar o da un código de error:
'****SCRIPT START****
' this script searches for all "security"-keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\ and deletes them
Option Explicit
Const HKEY_LOCAL_MACHINE = &H80000002
Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Dim oShell : Set oShell = CreateObject("WScript.Shell")
Dim sPath, aSub, sKey, aSubToo, sKeyToo, dwValue
' Get all keys within sPath
sPath = "SYSTEM\CurrentControlSet\Enum\IDE"
oReg.EnumKey HKEY_LOCAL_MACHINE, sPath, aSub
' Loop through each key
For Each sKey In aSub
'Get all subkeys within the key 'sKey'
oReg.EnumKey HKEY_LOCAL_MACHINE, sPath & "\" & sKey, aSubToo
For Each sKeyToo In aSubToo
oReg.deleteValue HKEY_LOCAL_MACHINE, sPath & "\" & sKey & "\" & sKeyToo , "Security"
if Err.Number<>0 then
MsgBox Err.Description ' FOR TESTING ONLY
Err.Clear
end if
Next
Next
'****SCRIPT END****
Tras una inspección más cercana, el valor solo puede ser eliminado por SISTEMA. Necesito agregar permisos completos de permiso de administrador para eliminar. No estoy seguro si debo continuar usando VBS u otro método para hacer esto en todas las PC (alrededor de 1000).
Gracias.