[英]Multiple commands on button click callShellApplication?
in my JScript HTA script I have a button that executes a CMD command when I press it: <button onclick="callShellApplication('ipconfig')">Your IP-Adress</button>
But this is only one command and I want to execute several.在我的 JScript HTA 脚本中,我有一个按钮,当我按下它时执行 CMD 命令:
<button onclick="callShellApplication('ipconfig')">Your IP-Adress</button>
但这只是一个命令,我想执行几个。 For example @echo hello + ipconfig, I need this because the system on which I execute the command has a CMD block, with the first command it always puts a cryptic character in front of it only with the second command is the command executed.例如@echo hello + ipconfig,我需要这个,因为我执行命令的系统有一个 CMD 块,第一个命令总是在它前面放一个神秘字符,只有第二个命令是执行的命令。 So to get around that I want to execute two commands.
所以为了解决这个问题,我想执行两个命令。 How do I do that?
我怎么做?
Best regards, jcjms最好的问候, jcjms
I will be critiqued for a one line answer rather than adding a full related code block but this is a minor mod from someone else's answer at https://stackoverflow.com/a/70138712/10802527我将批评单行答案而不是添加完整的相关代码块,但这是https://stackoverflow.com/a/70138712/10802527上其他人的答案的一个小模型
<button onclick="callShellApplication('cmd /d /c echo/ &ipconfig')">IP-Adress</button>
It is not perfect as it throws the black console widow up for a second before feedback is captured.它并不完美,因为它会在捕获反馈之前将黑色控制台寡妇抛出一秒钟。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.