- Dim a, entry, S, fso
-
- Set a=WScript.CreateObject("Shell.Application")
-
- Function B(Msg)
- On Error Resume Next
- Dim f,i,w
- Set w=CreateObject("WScript.Shell")
-
- Set f=a.BrowseForFolder(&H0&,Msg,&h1&)
- B=f.ParentFolder.ParseName(f.Title).Path
-
- If Err.Number<>0 Then
- If f.Title="Desktop" Then B=w.SpecialFolders("Desktop")
- i=InStr(f.Title, ":")
- If i>0 Then B=Mid(f.Title,i-1,2) & "\"
- End If
- End Function
-
-
- S = B("Choisissez un répertoire")
-
- while entry <> "ouvrir" and entry <> "supprimer" and entry <> "aucun"
- entry = inputbox("Ouvrir ou supprimer ?", "ouvrir/supprimer/aucun")
- wend
-
- if entry = "ouvrir" then
- a.open S
- elseif entry = "supprimer" then
- set fso = createobject("Scripting.FileSystemObject")
- fso.Deletefile(S), true
- End If
Dim a, entry, S, fso
Set a=WScript.CreateObject("Shell.Application")
Function B(Msg)
On Error Resume Next
Dim f,i,w
Set w=CreateObject("WScript.Shell")
Set f=a.BrowseForFolder(&H0&,Msg,&h1&)
B=f.ParentFolder.ParseName(f.Title).Path
If Err.Number<>0 Then
If f.Title="Desktop" Then B=w.SpecialFolders("Desktop")
i=InStr(f.Title, ":")
If i>0 Then B=Mid(f.Title,i-1,2) & "\"
End If
End Function
S = B("Choisissez un répertoire")
while entry <> "ouvrir" and entry <> "supprimer" and entry <> "aucun"
entry = inputbox("Ouvrir ou supprimer ?", "ouvrir/supprimer/aucun")
wend
if entry = "ouvrir" then
a.open S
elseif entry = "supprimer" then
set fso = createobject("Scripting.FileSystemObject")
fso.Deletefile(S), true
End If