我需要创建一个简单的HTA应用程序来请求一个命令,然后当我按下一个按钮时该命令应该在命令提示符下执行。javascript hta应用程序作为用于命令提示符的GUI
到目前为止,我只有以下脚本,它只会打开命令提示符窗口,但不会读取并运行输入到文本框中的脚本。
<html>
<head>
<HTA:APPLICATION>
<script type="text/javascript" language="javascript">
function Run() {
x = document.getElementById("command").value;
shell = new ActiveXObject ("Shell.Application");
shell.ShellExecute("cmd.exe", "/k ", "", "open", 1);
}
</script>
</head>
<body bgcolor="grey">
<form>
<h1> Enter MS-DOS Command </h1>
<p> eg: ipconfig </p>
<textarea cols="20" rows="1" id="command"> </textarea> <br> <br>
<input type="button" value="Run" onclick="Run();">
</form>
</body>
</html>
谢谢你这么多为你的帮助:) – student001
谢谢,谢谢。我只是在学习基础知识,你已经帮了很多! – student001