As the description of Wscript:String value indicating the command line used to run the script: The command line should appear exactly as it would if you typed it at the command prompt.
I can run my java file using the command "java test http://www.bbc.co.uk/news/world-us-canada-12116778"
but it is not working when I wrote the JavaScript below. Can someone can tell me why?
Thank you or can tell me there is some other method to call my Java file when I open a html file?
<script type="text/javascript">
funciton {}
var WshShell = new ActiveXObject("WScript.Shell");
var oExec= WshShell.Exec(""java test http://www.bbc.co.uk/news/world-us-canada-12116778"");
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
</script>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…