Windows bat 运行 vbs文件,怎样隐藏执行过程中的窗口
写了一个脚本,telent到目标机,修改目标IP,功能正常,但运行过程中有窗口,怎样隐藏运行,求助。。。。急~~~~~~~~在线等@echooff@delc:\temp....
写了一个脚本,telent 到目标机,修改目标IP,功能正常,但运行过程中有窗口,怎样隐藏运行,求助。。。。急~~~~~~~~在线等
@echo off
@del c:\temp.vbs
@echo on error resume next >>c:\temp.vbs
@echo set sh=WScript.CreateObject("WScript.Shell")>>c:\temp.vbs
::@echo sh.run, hide>>c:\temp.vbs
@echo WScript.Sleep 20 >>c:\temp.vbs
@echo sh.SendKeys "open %1{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "y{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "administrator{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "123456{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "netsh interface ipv4 set address ">>c:\temp.vbs
@echo sh.SendKeys Chr(34)>>c:\temp.vbs
@echo sh.SendKeys "LocalNetwork">>c:\temp.vbs
@echo sh.SendKeys Chr(34)>>c:\temp.vbs
@echo sh.SendKeys " static %2 %3 %4{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 200>>c:\temp.vbs
@echo sh.SendKeys "exit{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 50>>c:\temp.vbs
@echo sh.SendKeys "y{ENTER}{ENTER}{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 50>>c:\temp.vbs
@echo sh.SendKeys "quit{ENTER}">>c:\temp.vbs
start telnet.exe
cscript c:\temp.vbs
::@call c:\temp.vbs 展开
@echo off
@del c:\temp.vbs
@echo on error resume next >>c:\temp.vbs
@echo set sh=WScript.CreateObject("WScript.Shell")>>c:\temp.vbs
::@echo sh.run, hide>>c:\temp.vbs
@echo WScript.Sleep 20 >>c:\temp.vbs
@echo sh.SendKeys "open %1{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "y{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "administrator{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "123456{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 300>>c:\temp.vbs
@echo sh.SendKeys "netsh interface ipv4 set address ">>c:\temp.vbs
@echo sh.SendKeys Chr(34)>>c:\temp.vbs
@echo sh.SendKeys "LocalNetwork">>c:\temp.vbs
@echo sh.SendKeys Chr(34)>>c:\temp.vbs
@echo sh.SendKeys " static %2 %3 %4{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 200>>c:\temp.vbs
@echo sh.SendKeys "exit{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 50>>c:\temp.vbs
@echo sh.SendKeys "y{ENTER}{ENTER}{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 50>>c:\temp.vbs
@echo sh.SendKeys "quit{ENTER}">>c:\temp.vbs
start telnet.exe
cscript c:\temp.vbs
::@call c:\temp.vbs 展开
2个回答
展开全部
%1 start mshta vbscript:createobject("wscript.shell").run("局档和""%~0"" ::",0)(window.close)&&exit
第一行新起一桐盯行,蠢贺贴进去
追问
%1, %2 这些参数我在用,
::cscript c:\temp.vbs 注释掉直接调用
用下面的代替,您是这个意思吗
start mshta vbscript:createobject("wscript.shell").run(c:\temp.vbs)(window.close)&&exit
但好像不好用
追答
start mshta vbscript:createobject("wscript.shell").run(c:\temp.vbs)(window.close)&&exit
这个命令是运行VBS,VBS本身就不显示,所以没必要这样运行,而且这个命令会直接退出脚本,后面的没法继续了。
我之前的命令式写着第一行的,不是代替某行的命令
既然你在用百分之的参数,那么没办法了,只能新写一个VBS脚本,用它来调用BAT文件,达到隐藏效果。
展开全部
你好丛枣
加上代码
@echo off
if "%1"=="h"渗让拆 goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"滑伍" h",0)(window.close)&&exit
:begin
加上代码
@echo off
if "%1"=="h"渗让拆 goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"滑伍" h",0)(window.close)&&exit
:begin
更多追问追答
追问
有没有设置属性的,
WScript.hide 或者 sh.hide 类似的指令
::@echo sh.run, hide>>c:\temp.vbs
%1, %2 这些参数我在用啊
追答
你在 前面 加上 这句 就好了
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询