Et une facons que les antivirus ne capote pas car j'ai entendu parler que les antivirus pouvais donner alerte lorsque une clef ce suprime :| tk merci bien de me répondre
Gobillot
Messages postés3140Date d'inscriptionvendredi 14 mai 2004StatutMembreDernière intervention11 mars 201934 1 sept. 2004 à 02:40
Option Explicit
Const REG_SZ = 1 ' Unicode nul terminated String
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
' Add a program to the 'Run at Startup'
' Call SaveString(HKEY_LOCAL_MACHINE, StrPath, ProgramName, FileToRun)
' Remove a program from the 'Run at Start
Call DeleteValue(HKEY_LOCAL_MACHINE, StrPath, ProgramName)
End Sub
Private Sub SaveString(hKey As HKeyTypes, StrPath As String, strValue As String, strdata As String)
Dim keyhand As Long
Dim r As Long
r = RegCreateKey(hKey, StrPath, keyhand)
Text1 = r
r = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata))
Text2 = r
r = RegCloseKey(keyhand)
Text3 = r
End Sub
Private Function DeleteValue(ByVal hKey As HKeyTypes, ByVal StrPath As String, ByVal strValue As String)
Dim keyhand As Long
Dim r As Long
r = RegOpenKey(hKey, StrPath, keyhand)
Text1 = r
r = RegDeleteValue(keyhand, strValue)
Text2 = r
r = RegCloseKey(keyhand)
Text3 = r
End Function
bilaloch
Messages postés556Date d'inscriptionlundi 6 octobre 2003StatutMembreDernière intervention31 octobre 20191 1 sept. 2004 à 11:51
Bonjour,
Met ca, c plu facile :
'SUPPRIMER UNE VALEUR OU UNE CLE DU REGISTRE
Set WshShell = CreateObject("Wscript.Shell")
WshShell.RegDelete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Clef"
BruNews
Messages postés21040Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019 1 sept. 2004 à 12:02
bilaloch, machine script a proscrire pour acces base de registres, le prog se fera stopper a l'execution sur un systeme correctement configure.
Employer API dans tous les cas.