質問

I have this code:

<body background = "Image.png">

<body>
<input type="button" value="Option 1" name="run_button"  onClick="TestSub"><p>
<input type="button" value="Option 2" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 3" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 4" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 5" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 6" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 7" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 8" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 9" name="run_button"  onClick="TestSub"><p> 
<input type="button" value="Option 10" name="run_button"  onClick="TestSub"><p> 
</body>

When i run it it comes up with 10 buttons but my questions is how do i get it to launch a program called test.exe when the first button is pressed

役に立ちましたか?

解決

You need to create an ActiveX like so:

var shell = new ActiveXObject('WScript.Shell');
shell.Run(strCommand, intWindowStyle, bWaitOnReturn);

Please read the MSDN article about Run() to populate the arguments.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top