Les hotfixes

kesa7 Messages postés 27 Date d'inscription jeudi 21 août 2008 Statut Membre Dernière intervention 29 août 2008 - 28 août 2008 à 15:31
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 - 29 août 2008 à 15:36
salut

sous windows il existe des repertoires nommés  :  "$NtUninstallKB904942$" les autres ont a peut pret le meme nom
generalement ces repertoires sont cachés
je suis entrain de crée un programme qui me permet de supprimer les hotfixes qui se trouvent sous ces repertoires

je cherche un code qui me permet de supprimer soit les hotfixes c'est a dire les fichiers qui sont sous ces repertoires 
soit les repertoires et leurs contenue 
merci beaucoup 
aidez moi svp 
j'espere que j'ai respecté les reglements et j'ai bien expliqué mon probleme  

je travaille avec VB6 

6 réponses

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
28 août 2008 à 16:48
salut,

ces dossiers ne sont présents que lorsque l'option de suppression possible des correctifs WU est activée

il y a donc des UNINST, à lister par le registre.
en aucun cas il ne faut supprimer directement les dossiers (ni à la main ni par code), c'est le meilleur moyen d'avoir une liste de programmes de 50 bornes, impossible à désinstaller, et avec toujours des programmes résiduels....

donc : voir registre
++
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp  
0
cs_casy Messages postés 7741 Date d'inscription mercredi 1 septembre 2004 Statut Membre Dernière intervention 24 septembre 2014 40
28 août 2008 à 17:01
Ou utiliser des logiciels de nettoyage comme CCleaner par exemple

---- Sevyc64  (alias Casy) ----<hr size="2" width="100%" /># LE PARTAGE EST NOTRE FORCE #    http://aide-office-vba.monforum.com/index.php
0
kesa7 Messages postés 27 Date d'inscription jeudi 21 août 2008 Statut Membre Dernière intervention 29 août 2008
29 août 2008 à 08:37
salut
et oui CCleaner est deja installé
je suis entrain de crée une application VB6 qui ressemble à CCleaner jusqu'a maintenant j'ai effectué plusieurs taches de CCleaner telque : supprission des cookies, des temp internet,  de l'historique internet , des documents recent , des Url tappés récement, les index.dat,le nettoyage de menu demmarrer, vider la corbeille et presse papier
j'arrive pas à supprimer ou netoyer le reste
SVP : si vous pouvez aidez moi pour terminer mon programme merci
0
kesa7 Messages postés 27 Date d'inscription jeudi 21 août 2008 Statut Membre Dernière intervention 29 août 2008
29 août 2008 à 09:10
salut
voila j'ai trouvé un code en VBscripte qui permet la suppression  des hotfixes mais je travail avec VB6
je veux  une solution
merci beaucoup 
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
kesa7 Messages postés 27 Date d'inscription jeudi 21 août 2008 Statut Membre Dernière intervention 29 août 2008
29 août 2008 à 09:13
salut
j'ai oublié de tapper le code en VBscripte le voila 

 ----------------------------------------------------------
' Script de suppression des dossiers de dnstallation de
' hotfixes sous Windows 2000, XP, 2003 ...
'
' Syntaxe: delUninstall
'
'
' JC BELLAMY  2003-2005
' Mises our :
' 16/08/2005 : ajout de la suppression des fichiers log
'   11/03/2008 : ajout d'affichage de la date des dossiers
' ----------------------------------------------------------
On error resume next
Const SW_HIDE= 0
Const SW_SHOWNORMAL=1
ColorBack="""#FFFFD8"""
BGProgressON="blue"
BGProgressOFF=ColorBack
Const HKEY_CURRENT_USER  = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD  = 4
Const REG_MULTI_SZ = 7

Dim shell,fso,oIE,NbHF,HFFolders(),HFKeys(),HFarticle()
Set shell = WScript.CreateObject("WScript.Shell")
Set fso   = WScript.CreateObject("Scripting.FileSystemObject")

shell.Popup "Veuillez patienter quelques instants ...",3,"Recherche des dossiers de correctif et service pack",64
' Autoriser le contenu actif 'exter dans les fichiers de la zone Ordinateur local
LockDown="HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_LOCALMACHINE_LOCKDOWN"
Keysec1=LockDown & "iexplore.exe"
Oldvalue1=shell.RegRead(Keysec1)
If Err.Number<>0 Then
Err.Clear
Oldvalue1=1
End If
shell.RegWrite Keysec1,0,"REG_DWORD"

Keysec2=LockDown & "Settings\LOCALMACHINE_CD_UNLOCK"
Oldvalue2=shell.RegRead(Keysec2)
If Err.Number<>0 Then
Err.Clear
Oldvalue2=0
End If
shell.RegWrite Keysec2,1,"REG_DWORD"

ficInit  = GetPath() & "deluninstall.html"
Titre="Suppression des dossiers de dnstallation de hotfixes"
Set ts = fso.CreateTextFile(ficInit, True)
ts.writeline header
ts.writeline ScriptBtn

Windir=shell.ExpandEnvironmentStrings("%systemroot%")
Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
LastKey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey"
ts.writeline "Dossier syst : " & Windir & " "
ts.writeline "<hr><form name =""strategyForm"">"
ts.writeline "\"
ts.writeline \"----
Suppr., Lien MSDN, Dossier, Date, Clef BDR, \"
ts.writeline \"----
, \"
ts.writeline \"</td>Tout (delectionner"
ts.writeline ",  "
ts.writeline ",  "
ts.writeline ",  , \"

set fWindir=fso.GetFolder(Windir)
set collf=fWindir.SubFolders
Index=0
For each subf in collf
fName=subf.Name
fDate=subf.DateCreated
Sdate=Cadrage(Day(fDate)) & \"/\" & Cadrage(Month(fDate)) & \"/\" & Year(fDate)
lName=len(fName)
Uninst=false
Suffixe=\"\"
If InStr(1,fName,\"$\",vbTextCompare)=1 then Suffixe=GetKeyFromFolder(fName)
If Suffixe<>\"\" Then
Index=Index+1
redim preserve HFFolders(Index),HFKeys(Index),HFarticle(Index)
NumArticle=\"\"
HFFolders(Index-1)=fName
HFKeys(Index-1)=Suffixe
ts.writeline \"----
"
ts.writeline ", \"
HelpLink=Shell.RegRead(\"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\\" & Suffixe & \"\HelpLink\")
If Err.number=0 Then
p=InstrRev(HelpLink,\"=\")
If p>0 Then NumArticle=Mid(HelpLink,p)
ts.writeline \"MSDN " & Numarticle & ", \"
else
Err.Clear
ts.writeline \" , \"
End If
HFarticle(Index-1)=NumArticle
ts.writeline \"" & fName & ", \"
ts.writeline \"" & SDate & ", \"
ts.writeline \"" & Suffixe & ", \"
ts.writeline \"\"
end if
Next
NbHF=Index
ts.writeline "
"
ts.writeline ""
ts.writeline ""
ts.writeline "</form>"
ts.writeline ProgressBar
ts.writeline "JCB  2008"
ts.writeline "</html>"
ts.close
codeRet=RunIE(640,480)
If coderet<=0 Then
If coderet=0 Then oIE.Quit
wscript.quit
end if
NbDel=0
For i = 1 To NbHF
Action=eval("oIE.document.strategyForm.CB" & i & ".checked")
Taux=i*100/NbHF
If Action Then
NbDel=NbDel+1
fso.DeleteFolder Windir & "" & HFFolders(i-1),true
LogFile= Windir & "" & HFKeys(i-1) & ".log"
If fso.FileExists(LogFile) Then fso.DeleteFile LogFile,true
shell.RegDelete Key & HFKeys(i-1) & ""
msgerr=""
If err.number<>0 Then
msgerr=" Erreur suppression"
err.clear
End If
SetProgress "Suppr." & HFarticle(i-1) & msgerr,taux
else
SetProgress "      ",Taux
End If
Next
oIE.Quit
If NbDel>1 Then pluriel="s" else pluriel=""
wscript.echo NbDel & " dnstallation" & pluriel & " de hotfixes supprim & pluriel
' Restauration t
shell.RegWrite Keysec1,OldValue1,"REG_DWORD"
shell.RegWrite Keysec2,OldValue2,"REG_DWORD"
Wscript.quit

'--------------------------------------------------------------------
Function RunIE(W,H)
RunIE=1
' Ouverture d'Internet Explorer
Set oIE = WScript.CreateObject("InternetExplorer.Application")
Do While (oIE.Busy)   
WScript.Sleep 100 
Loop
oIE.navigate ficInit
oIE.Height = H
oIE.Width = W
oIE.MenuBar = 0        
oIE.ToolBar = 0
oIE.StatusBar = 1
oIE.Top=(oIE.Document.ParentWindow.Screen.Height-oIE.Height)/2
oIE.Left=(oIE.Document.ParentWindow.Screen.Width-oIE.Width)/2
oIE.Visible = 2     

shell.AppActivate Titre

' Attente d'action sur le bouton ou fermeture de la fene
Do                  
WScript.Sleep 100
Selection=oIE.Document.Script.CheckSelect()
If Selection<>0 Then
oIE.Document.Script.ResetSelect
If oIE.document.strategyForm.allselect.checked Then StrFlag="true" else StrFlag="false"
For i = 1 To NbHF
execute("oIE.document.strategyForm.CB" & i & ".checked=""" & StrFlag & """")
Next
End If
FlagParam=oIE.Document.Script.CheckParam()
If FlagParam<>0 Then
param=oIE.Document.Script.GetParam()
oIE.Document.Script.ResetParam
typeobj=left(param,1)
path=mid(param,2)
Select Case typeobj
Case "1"
Shell.run "explorer /n,/root," & Windir & "" & path & "",1
Case "2"
Shell.RegWrite LastKey, Key & path
oIE.Visible = 0
shell.Run "REGEDIT",1,true
oIE.Visible = 1
End Select
End If
Check=oIE.Document.Script.CheckVal()
Loop While (Check = 0)
' Si on ferme directement IE sans passer par un bouton,
' cela provoque une erreur qui est dctet alors
' on quitte le script
If Err <> 0 Then
RunIE=-1
Err.Clear
else
If Check=-1 Then RunIE=0
end if
End Function
'--------------------------------------------------------------------
' Fonction de rption du rrtoire courant
Function GetPath()
Dim path
path = WScript.ScriptFullName
GetPath = Left(path, InStrRev(path, ""))
End Function
'--------------------------------------------------------------------
Function Header
s="<!-- saved from url=(0024)http://www.bellamyjc.org -->"
s=s & "<html><head><title>" & Titre & "</title>" & VBCRLF
s=s & "<STYLE TYPE=""text/css"">" & VBCRLF
s=s & "body {" & VBCRLF
s=s & " font-family: Verdana;" & VBCRLF
s=s & " font-size: 8 pt }" & VBCRLF
s=s & " h1, h2, h3, h4, h5  { font-family: Verdana }" & VBCRLF
s=s & "table {" & VBCRLF
s=s & " table-border-color-light: " & ColorBorderL &";" & VBCRLF
s=s & " table-border-color-dark:  " & ColorBorderD &";" & VBCRLF
s=s & " font-size: 8 pt;" & VBCRLF
s=s & " font-family: Verdana }" & VBCRLF
s=s & ".progressOFF {background-color :" & BGProgressOFF & ";}" & VBCRLF
s=s & ".progressON {background-color :" & BGProgressON &";}" & VBCRLF
s=s & "</STYLE></head>"
header=s
End Function
'--------------------------------------------------------------------
Function ScriptBtn
s="<script language=""VBScript""> "  & VBCRLF
s=s & "<!--" & VBCRLF
s=s & "Dim ready,FlagParam,Param,Selection" & VBCRLF
s=s & "Sub B0_OnClick" & VBCRLF
s=s & "ready=-1" & VBCRLF
s=s & "End Sub" & VBCRLF
s=s & "Sub B1_OnClick" & VBCRLF
s=s & "ready=1" & VBCRLF
s=s & "End Sub" & VBCRLF
s=s & "function Explore(filename)"  & VBCRLF
s=s & "FlagParam=1"  & VBCRLF
s=s & "Param=filename"  & VBCRLF
s=s & "End function"  & VBCRLF
s=s & "Sub Window_OnLoad()" & VBCRLF
s=s & "ready=0" & VBCRLF
s=s & "FlagParam=0"  & VBCRLF
s=s & "Param="""""  & VBCRLF
s=s & "Selection=0" & VBCRLF
s=s & "End Sub" & VBCRLF

s=s & "Public Function CheckVal()" & VBCRLF
s=s & "CheckVal=ready" & VBCRLF
s=s & "End function" & VBCRLF

s=s & "Public Function CheckParam()" & VBCRLF
s=s & "CheckParam=FlagParam" & VBCRLF
s=s & "End function" & VBCRLF

s=s & "Public Sub ResetParam()" & VBCRLF
s=s & "FlagParam=0" & VBCRLF
s=s & "End sub" & VBCRLF

s=s & "Public Function GetParam()" & VBCRLF
s=s & "GetParam=Param" & VBCRLF
s=s & "End function" & VBCRLF

s=s & "Public Function CheckSelect()" & VBCRLF
s=s & "CheckSelect=Selection" & VBCRLF
s=s & "End function" & VBCRLF

s=s & "Public Sub ResetSelect()" & VBCRLF
s=s & "Selection=0" & VBCRLF
s=s & "End sub" & VBCRLF

s=s & "Public Sub SetSelect()" & VBCRLF
s=s & "Selection=1" & VBCRLF
s=s & "End sub" & VBCRLF

s=s & "'-->" & VBCRLF
s=s & "</script>"
ScriptBtn=s
End Function
'--------------------------------------------------------------------
Function ProgressBar
s=s & "\" & VBCRLF
s=s & \"----
" & VBCRLF
s=s & "<table border=""0"" cellpadding=""2"" cellspacing=""2"" style=""border-collapse: collapse"" bordercolor=""#111111"">" & VBCRLF
s=s & "----
" & VBCRLF
For indl = 1 To 20
s=s & ",     </td>\" & VBCRLF
Next
s=s & "
</td></tr></table>" & VBCRLF
s=s & "      
" & VBCRLF
ProgressBar=s
End Function
'--------------------------------------------------------------------
Sub SetProgress(lib,taux)
set objLib=oIE.Document.All("lib")
set objTab=oIE.Document.All("tabprog")
objTab.border="1"
k=int(taux/5)
objLib.innerhtml=lib
for numc= 1 to 20
set objCell=oIE.Document.All("c" & numc)
if numc<=k then className="progressON" else className="progressOFF"
objCell.className=className
next
End Sub
'--------------------------------------------------------------------
Function GetKeyFromFolder(folder)
GetKeyFromFolder=""
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys
trouve=false
For Each subkey In arrSubKeys
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath & "" & subkey,"UninstallString",UninstallString
If InStr(1,UninstallString,Folder,vbTextCompare)>0 Then
trouve=true
GetKeyFromFolder=subkey
exit function
End If
Next
End Function
'--------------------------------------------------------------------
Function Cadrage(n)
If n<=9 Then Cadrage="0" & CStr(n) Else Cadrage= CStr(n)
End Function
'--------------------------------------------------------------------
0
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
29 août 2008 à 15:36
Bah pour moi, la façon "gros sauvage" me convient très bien : je vire ces dossiers via Total Commander et ensuite je passe par Registry Mechanic.
Et voilà. Pas besoin d'un programme VB pour le faire à ma place !!
_________________________________________________________________________
VB.NETis good ...VB6is better<
0
Rejoignez-nous