Comment faire un VBS pour plusieurs actions

Résolu
Arwen -  
 Profil bloqué -
Bonjour,

Je désire faire un VBS qui fait:
1-Rechercher une clef de registre dans: HKLM\Microsoft\Windows\CurrentVersion\Uninstall
2-Si la clef existe, msiexec /x GUID /QN /L*V "C:\Windows\Temp\ToTo.log"
3-If exist "C:\Program Files\Adobe\Reader\plug-ins\FileOpen.api" DEL "C:\Program Files\Adobe\Reader\plug-ins\FileOpen.api"
4-Executer: msiexec /i FileOpen.msi /QN /L*V "C:\Windows\Temp\FileOpen.log"

Merci

1 réponse

  1. Profil bloqué
     
    Explique mieux
    si tu veux voila des codes
    modifier valeur registre
    Set WshShell = CreateObject("WScript.Shell")
    WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center\AntiVirusDisableNotify", "1"
    Set WshShell = Nothing
    supprimer clé
    Const HKEY_LOCAL_MACHINE = &H80000002

    strComputer = "."

    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

    strKeyPath = "SOFTWARE\lol"

    oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
    tester l'existence d'une clé
    Function RegExists(value)
    On Error Resume Next
    Set WS = CreateObject("WScript.Shell")
    val = WS.RegRead(value)
    If (Err.number = -2147024893) or (Err.number = -2147024894) Then
    RegExists = False
    Else
    RegExists = True
    End If
    End Function

    If RegExists ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\") Then
    MsgBox "La valeur existe."
    Else
    MsgBox "La valeur n'existe pas."
    End If
    0