1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| 'Ce vbscript sert pour sélectionner un dossier ou bien un lecteur pour afficher tous les fichiers et les sous-dossiers systèmes cachés dans ce dernier
Option Explicit
Dim Copyright,MonDossier,MaCmd
Copyright = " © Hackoo © 2015"
MonDossier = Parcourir_Dossier()
MaCmd = "Attrib -s -h -r " & DblQuote(MonDossier) &"\*.* /S /D"
Call Executer(MaCmd,0)
Call Explore(DblQuote(MonDossier))
'****************************************************************************************************
Function Parcourir_Dossier()
Dim objShell,objFolder,Message
Message = "Veuillez sélectionner un dossier pour afficher tous les fichiers et les sous-dossiers systèmes cachés dans ce dernier"& Copyright &""
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0,Message,1,"c:\Programs")
If objFolder Is Nothing Then
Wscript.Quit
End If
Parcourir_Dossier = objFolder.self.path
end Function
'****************************************************************************************************
Function Executer(StrCmd,Console)
Dim ws,MyCmd,Resultat
Set ws = CreateObject("wscript.Shell")
'La valeur 0 pour cacher la console MS-DOS
If Console = 0 Then
MyCmd = "CMD /C " & StrCmd & ""
Resultat = ws.run(MyCmd,Console,True)
If Resultat = 0 Then
Else
MsgBox "Une erreur inconnue est survenue !",16,"Une erreur inconnue est survenue !"
End If
End If
'La valeur 1 pour montrer la console MS-DOS
If Console = 1 Then
MyCmd = "CMD /K " & StrCmd & ""
Resultat = ws.run(MyCmd,Console,False)
If Resultat = 0 Then
Else
MsgBox "Une erreur inconnue est survenue !",16,"Une erreur inconnue est survenue !"
End If
End If
Executer = Resultat
End Function
'****************************************************************************************************
Function DblQuote(Str)
DblQuote = Chr(34) & Str & Chr(34)
End Function
'****************************************************************************************************
Function Explore(filename)
Dim ws
Set ws=CreateObject("wscript.Shell")
ws.run "Explorer /n,/select,"& filename &" "
End Function
'**************************************************************************************************** |
Partager