' Script de correction pour les valeurs de registre afin de personaliser le poste: ' ------------------------------------------------------------------------ ' ******************************************************************************** ' * ' * Objets réseau WSH. ' * '----------------------------------------------------------------------------------------------------------------------------------------------- Option Explicit ' Force la vérification de la cohérence de la déclaration des variables '----------------------------------------------------------------------------------------------------------------------------------------------- Dim CRLF Dim Texte,Temps Dim Information, Info_Res Dim Affiche Dim WSHNetwork ' Variables utilisées pour déclarer des constantes Dim WSHShell ' qui seront utilisées de façon récursive dans les programmes: ' ceci "allège" l'écrriture des fonctions... Dim ObjRegistry Dim StrComputer CRLF = Chr(13) & Chr(10) Set WSHNetwork = CreateObject("WScript.Network") Set WshShell = CreateObject("Wscript.Shell") Temps = 3 Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER = &H80000001 Call Regedit_V2 '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sub regedit StrComputer= "." ' C'est en local que ça se passe... Set WshShell = CreateObject("Wscript.Shell") Texte = " Affichage des fichier/répertoires cachés " & CRLF & _ " ainsi que des fichiers système." & CRLF & CRLF & _ "(Lancement en automatique dans 3 secondes)" Affiche = WSHSHell.popup (Texte,3,"Les modifications:") With WSHShell On Error Resume Next .RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"), "1" ,"REG_DWORD" .RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ShowSuperHidden"), "1" , "REG_DWORD" .Setinfo Call R_Final (" Ca doit être bon, maintenant !") End With Info = "Procédure de correction de registre terminée." & CRLF Affiche = WSHSHell.popup (info,Temps,"Opération terminée") Set WshShell = Nothing End Sub '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sub Message (information) Affiche = WSHSHell.popup (information,2,"Modification:") End sub '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sub R_Final (info_Res) Affiche = WSHSHell.popup (info_Res,1,"Résultat de l'opération:") End sub '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sub Regedit_V2 StrComputer= "." ' C'est en local que ça se passe... Dim StrKeyPath, ValueName, DW_Value Dim StrKeyPath_2, ValueName_2, DW_Value_2 Dim ObjReg Set WshShell = CreateObject("Wscript.Shell") Texte = " Affichage des fichier/répertoires cachés " & CRLF & _ " ainsi que des fichiers système. V2" & CRLF & CRLF & _ "(Lancement en automatique dans 3 secondes)" Affiche = WSHSHell.popup (Texte,3,"Les modifications:") Set ObjReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") StrkeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\" ValueName = "Hidden" DW_Value = 1 StrkeyPath_2 = "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\" ValueName_2 = "ShowSuperHidden" DW_Value_2 = 1 With ObjReg On Error Resume Next .SetDWordValue HKey_Current_User, StrKeyPath, ValueName , DW_Value .SetDWordValue HKey_Current_User, StrKeyPath_2, ValueName_2 , DW_Value_2 Call R_Final (" Ca doit être bon, maintenant !") End With Info = "Procédure de correction de registre terminée." & CRLF Affiche = WSHSHell.popup (info,Temps,"Opération terminée") Set WshShell = Nothing End Sub '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------