我试图弄清楚我们是否可以从 html 或 javascript 执行 WMIC。
wmic code : wmic /node:"server" /output:"C:test2.html" SERVICE where (state=”running”) get Name, Caption, State, ServiceType, StartMode, pathname /FORMAT:"htable.xsl"
html代码:
<html>
<head>
<script language="JScript">
Function cmds1()
{
var run=new ActiveXObject('WSCRIPT.Shell').Run("commands to run");
objShell.ShellExecute("cmd.exe", "", "", "open", 2);
}
</script>
<form name="input" action="test.asp" method="get">Server name <input type="text" name="Server">
<input id="E1" type="button" value="submit" onClick="cmds1()">
</form>