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 55 56 57
| <html><head><TITLE>Gestion programmes</TITLE>
<HTA:APPLICATION
ICON ='POINT10.ICO'
APPLICATION ='lanceur'
MAXIMIZEBUTTON='no'
SCROLL ='no'> </head>
<script language='VBScript'>
option explicit
dim objShell , oFso
Set oFso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
self.document.TITLE= oFSO.getFolder(objShell.CurrentDirectory).name
window.moveTo 20,20
window.resizeTo 330,530 'window.screen.availHeight
'_______________________________________________________________________________
Sub Window_onLoad
dim ofl
For each oFl in oFSO.GetFolder(objShell.CurrentDirectory).Files
call ajout_lst("hta",ofl.name)
next
For each oFl in oFSO.GetFolder(objShell.CurrentDirectory).Files
call ajout_lst("vbs",ofl.name)
next
lst.size = lst.length
lst.value = ""
end sub
'_______________________________________________________________________________
Function execute(nx)
lst.value = ""
objShell.Run oFSO.GetFile(nx).shortpath
end Function
'_______________________________________________________________________________
Sub Window_onunLoad
Set oFso = nothing
Set objShell = nothing
end sub
'_______________________________________________________________________________
sub ajout_lst(ext,v)
dim oOption ,exte ,txt
exte = ofso.GetExtensionName(v)
if ext <> exte then exit sub
txt = exte & " " & left(v,len(v)-4)
Set oOption = Document.createElement("OPTION")
oOption.style.backgroundcolor = "yellow"
oOption.Text = txt
oOption.Value = v
lst.Add(oOption)
end sub
'_______________________________________________________________________________
</script>
<body bgcolor='aqua' >
<SELECT NAME='lst' onclick="execute lst.value" ></select>
</body> </html> |
Partager