'----------------------------------------------------------- 'Script de désinstallation complete de PopitNG ' ' Tue la tache PopitNG.exe si active ' Supprime les fichiers dat, bak et reseau ' Supprime le dossier 'PopitNG Files' ' Supprime le/les icones PopitNG bureau ' Supprime les paramêtres de la BDR ' Supprime le fichier popit.ini ' Supprime ce fichier '----------------------------------------------------------- On error resume next Dim shell, fso, network Dim res, msg msg = "ATTENTION !!! Ce programme va supprimer tous les fichiers crées par PopitNG - Voulez-vous continuer ?" & vbcrlf msg = msg & "WARNING !!! This program will delete all files created by PopitNG - Do you wish to continue ?" if (MsgBox (msg, 36, "PopitNG Clean"))=7 then wscript.quit end if Set shell = WScript.CreateObject("WScript.Shell") Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set network = Wscript.CreateObject("WScript.Network") '######################################## '## Tue la tache PopitNG.exe si active ## '######################################## Dim liste_des_Process_en_cours, Process, Str_Process_PopitNG Set liste_des_Process_en_cours=GetObject("winmgmts:{impersonationLevel=impersonate}!//" & Ucase(network.ComputerName)).InstancesOf ("Win32_process") for each Process in liste_des_Process_en_cours If InStr(1,Process.Name, "Popit", vbTextCompare)>0 Then res=Process.terminate(0) Exit For End if next '############################################## '## Supprime les fichiers dat, bak et reseau ## '############################################## Dim reg_filename, path_filename Dim reg_network, path_network reg_filename = "HKEY_CURRENT_USER\SOFTWARE\PopitNG\DEFAULT\filename" path_filename = shell.RegRead(reg_filename) If fso.FileExists(path_filename) then fso.DeleteFile path_filename, true fso.DeleteFile left(path_filename, len(path_filename)-3) & "bak", true end if reg_network = "HKEY_CURRENT_USER\SOFTWARE\PopitNG\NETWORK\SharedFile" path_network = shell.RegRead(reg_network) If fso.FileExists(path_network) then fso.DeleteFile path_network, true end if '######################################### '## Supprime le dossier 'PopitNG Files' ## '######################################### Dim reg_mesDocuments, path_PopitNG_Files reg_mesDocuments = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal" path_PopitNG_Files = shell.RegRead(reg_mesDocuments) & "\PopitNG Files" If fso.FolderExists(path_PopitNG_Files) then fso.DeleteFolder path_PopitNG_Files, true end if '########################################### '## Supprime le/les icones PopitNG bureau ## '########################################### Dim reg_bureau, path_Bureau reg_bureau = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop" path_bureau = shell.RegRead(reg_bureau) Dim fs,list_files,file, curfile Set fs=fso.GetFolder(path_bureau) Set list_files=fs.Files for each file in list_files curfile=file.name if inStr(lcase(curfile),"popit")>0 then fso.DeleteFile path_bureau & "\" & curfile, true end if next '############################### '## Supprime la cle 'PopitNG' ## '############################### Const HKEY_CURRENT_USER = &H80000001 Dim reg_PopitNG reg_PopitNG = "Software\PopitNG" DeleteKey HKEY_CURRENT_USER, reg_PopitNG '################################ '## Supprime le démarrage Auto ## '################################ Dim reg_AutoSart reg_AutoStart = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\PopitNG" shell.RegDelete(reg_AutoStart) '################################### '## Supprime le fichier popit.ini ## '################################### Dim windir Set windir = fso.GetSpecialFolder(0) fso.DeleteFile Windir & "\popit.ini", true '######################### '## Supprime ce fichier ## '######################### fso.DeleteFile wscript.ScriptFullName, true If (err.number<>0) Then err.clear WScript.Quit '## Sub ## Sub DeleteKey(Ruche, reg_Path) Dim subKeys, subKeyCount, objRegistry, res1, res2, Key Set objRegistry = GetObject("winmgmts:root\default:StdRegProv") res1 = objRegistry.EnumKey(Ruche, reg_Path, subKeys) If IsArray(subKeys) Then for each Key in subKeys DeleteKey Ruche, reg_Path & "\" & Key next End If res2 = objRegistry.DeleteKey(Ruche, reg_Path) End Sub