起動ごとに遅延のあるランチャーを使用するために、vbs と csv 構成ファイルを使用して hta スクリプトを作成しようとしています。次に、動作しますが、いくつかの問題があります。hta ファイルを実行すると、すべてのソフトウェアが最初から同時に起動されます。すべてのテキストが遅延を尊重して表示された後。最初の目的は、ソフトウェアを遅延を考慮して起動し、各起動後に各テキストを表示することでした。最後の問題は、csv ファイルの読み取りの最後にあり、vbs スクリプトが停止したように見え、hta 自体が閉じません。
csv ファイル:
Horloge,Nom,Delai,Soft,Resultat
MonTimer1,Start01,10000,C:\Program Files\IZArc\IZArc.exe,Izarc a bien été lancé
MonTimer2,Start02,15000,C:\Program Files\Moffsoft FreeCalc\MoffFreeCalc.exe,La calculatrice a bien été lancée
MonTimer3,Start03,20000,,All Tasks have been executed !
MonTimer4,Startfin,25000,,hta will now close !
hta ファイル:
<!-- ----- ExeScript Options Begin -----
ScriptType: window,invoker
DestDirectory: temp
Icon: D:\Bureau\startapp.bmp
File: D:\Bureau\startapp.bmp
----- ExeScript Options End ----- -->
<head>
<title>Start App</title>
<HTA:APPLICATION
APPLICATIONNAME="Start App"
ID="startapp"
VERSION="1.2"
MAXIMIZEBUTTON="no"
ICON="startapp.ico"
SCROLL="no"
SINGLEINSTANCE="yes"
SELECTION="no"/>
<SCRIPT TYPE="text/javascript">
window.resizeTo(350,275);
window.moveTo(10,10);
</SCRIPT>
<SCRIPT language="vbscript">
Sub Window_onLoad
StartTimer
End Sub
Sub StartTimer
MonTimer0 =window.setTimeOut ("welcome", 1000, "VBScript") 'Appel de MonScript
End sub
Sub Welcome
S = SetTimeOut("MaSub (""Vos applications vont se lancer dans un instant... Veuillez patienter..."")", 100)
End Sub
Dim Horloge
Dim Nom
Dim Delai
Dim Soft
Dim Resultat
Dim aVars
aVars = Array( "Horloge", "Nom", "Delai", "Soft", "Resultat" )
Dim oFSO
Set oFSO = CreateObject( "Scripting.FileSystemobject" )
Const INPUT_FILE = "StartApp.csv"
Dim oStream
Dim sData
Dim aData
Set oStream = oFSO.OpenTextFile( INPUT_FILE )
oStream.SkipLine
Do While oStream.AtEndOfStream = False
sData = oStream.ReadLine
aData = Split( sData, "," )
For i = 0 To UBound( aData )
Execute aVars( i ) & " = " & Chr( 34 ) & aData( i ) & Chr( 34 )
Next
'At this point all the vars referred to in aVars have the values
'of the current record
'START APP
'WSCript.Echo Horloge, Nom, Delai, Soft, Resultat
Set WshShell = CreateObject ("Wscript.Shell")
WshShell.Run Chr(34) & soft
S = SetTimeOut("MaSub (" & Chr(34) & Resultat & Chr(34) & ")", Delai)
'If oStream.AtEndOfStream = False Then
' window.close()
' End If
Loop
oStream.Close
</SCRIPT>
</head>
<Body STYLE="font:10 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')" >
<p><center> <img src=".\startapp.bmp" /> </center></p>
<br/><br/><br/>
<p><center>
<span style="color:white">
<div id = D></div>
<script language = vbs>
Sub MaSub (E)
Document.All.D.innerHTML = E
ClearTimeOut S
End Sub
</script>
</center></p>
</span>
</body>
</html>
あなたが私を助けることができればありがとう