1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Const Key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\"
Const sValue = "DisableRegistryTools"
Dim Obj, sData,Msg
sData = InputBox("Choisir une valeur :" & vbNewLine _
& "0 pour activer le registre" & vbNewLine _
& "1 pour désactiver le registre" & vbNewLine _
& "Quel est votre choix ?",, 0)
If sData <> "" And (sData <= 1 and sData>=0) Then
Set Obj = WScript.CreateObject("WScript.Shell")
Obj.RegWrite Key & sValue, sData, "REG_DWORD"
Else MsgBox "Une erreur s'est produite suite à une" _
& VbNewLine & "valeur entrée non valide. Recommencer" _
& VbNewLine & "en mettant soit 0 soit 1.",VbCritical,"Erreur..."
Wscript.Quit
End if
If Err Then
MsgBox Err.Description, vbOKOnly + vbCritical, "Erreur d'enregistrement","Reg Error"
Else:
If sData="0" then
Msg="La modification du registre est activée"
ElseIf sData="1" then
Msg="La modification du registre est désactivée"
end if
MsgBox Msg, vbInformation,"RegWrite"
End If
Set Obj = Nothing |
Partager