当前位置: 代码迷 >> JavaScript >> JavaScript 调用CMD下令
  详细解决方案

JavaScript 调用CMD下令

热度:223   发布时间:2012-07-15 20:11:29.0
JavaScript 调用CMD命令

JavaScript 调用CMD命令
2011年09月01日
  以下文件保存为 *.js
  WshShell = WScript.CreateObject("WScript.Shell");
  WshShell.Run("cmd.exe");
  WScript.Sleep(1000);
  WshShell.AppActivate("cmd.exe");
  WScript.Sleep(1000);
  WshShell.AppActivate("Telnet 8.1.91.110");
  WshShell.SendKeys("telnet 8.1.91.110{ENTER}");
  WshShell.SendKeys("tftp 8.1.78.74 get 001.CC{ENTER}");
  WshShell.SendKeys("startup system-software 001.CC{ENTER}");
  WshShell.SendKeys("reboot{ENTER}");
  WshShell.SendKeys("y{ENTER}");
  WshShell.SendKeys("y{ENTER}");
  WScript.Sleep(1000);
  然后写一批处理:
  cscript *.js
  http://www.shareba.com/Article/ShowArticle.asp?Art icleID=984 
  
  
  相关解决方案