把如下代码保存为批处理(*.bat)
rem ================
@del c:\\temp.vbs
@echo on error resume next >>c:\\temp.vbs
@echo dim WshShell>>c:\\temp.vbs
@echo Set WshShell = WScript.CreateObject("WScript.Shell")>>c:\\temp.vbs
@echo WshShell.run"cmd">>c:\\temp.vbs
@echo WshShell.AppActivate"c:\\windows\\system32\\cmd.exe">>c:\\temp.vbs
@echo WScript.Sleep 200>>c:\\temp.vbs
@echo WshShell.SendKeys"telnet 192.168.1.1">>c:\\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\\temp.vbs
@echo WScript.Sleep 100>>c:\\temp.vbs
@echo WshShell.AppActivate"telnet.exe ">>c:\\temp.vbs
@echo WScript.Sleep 2000>>c:\\temp.vbs
@call c:\\temp.vbs
rem ================