2

私はスクリプト、vbs、および HTA コマンドを初めて使用しますが、日付と現在の時刻を表すいくつかのテキスト ボックスを含む単純な hta フォルダーを作成しようとしました。その日付/時間を取得してそれらを使用する特定の cmd コマンドを実行する必要があります。コードを読んでいただくとより理解が深まると思います。

<html>
<head>
<title>HTA Test</title>
<HTA:APPLICATION 
 ID="objTest" 
 APPLICATIONNAME="HTA Test"
 SCROLL="no"
 SINGLEINSTANCE="yes"
>
</head>

<SCRIPT LANGUAGE="VBScript">
Sub TestSub
Dim Shell
Set Shell = WScript.CreateObject ("WScript.Shell")
Shell.run WScript "cmd /g applStart.sh SetTime.dat Year.Value-Month.Value-Day.Value-          Hour.Value-Minute.Value-Second.Value"
Set Shell = Nothing
End Sub
</SCRIPT>
<body>
 Type in the date you want to jump to:</br>

<input type="number" name="Day" size="2">
<input type="number" name="Month" size="2">
<input type="number" name="Year" size="4">
<input type="number" name="Hour" size="2">
<input type="number" name="Minute" size="2">
<input type="number" name="Second" size="2">

<input id=runbutton  type="button" value="Run Script" name="run_button"   onClick="TestSub">

ねえ、迅速な対応に感謝します。私が望むものの一部を実行することができました.settime.shの部分は実際にはパテのコマンドであり、執筆の時点ではよくわかりませんでしたが、実行ボタンを押すとパテが実行されるようになりました。次に、ユーザーがテキスト ボックスに指定した値を使用してコマンドを入力する必要があります。

<SCRIPT LANGUAGE="VBScript">
Sub RunProgram 
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run "C:\Users\uidv4860\Desktop\Getlogs\PuTTY\putty.exe -load EOBR"
End Sub

</SCRIPT>
<body>
Type in the date you want to jump to:</br>
Day:
<input type="int" name="fDay" size="2" maxLength="2">
Month:
<input type="int" name="fMonth" size="2" maxLength="2">
Year:
<input type="int" name="fYear" size="4" maxLength="4">
Hour:
<input type="int" name="fHour" size="2" maxLength="2">
Minute:
<input type="int" name="fMinute" size="2" maxLength="2">
Second:
<input type="int" name="fSecond" size="2" maxLength="2">
<button onclick="RunProgram">Run Program</button> <p>
</body>
4

1 に答える 1