以下文件保存为 *.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?ArticleID=984
本文介绍了一种通过JavaScript脚本实现对设备进行远程控制的方法。具体步骤包括使用WScript对象创建shell、运行CMD命令、激活telnet连接并发送一系列控制指令来完成设备重启及软件更新等操作。
2502

被折叠的 条评论
为什么被折叠?



