十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
这篇文章主要介绍VBS如何实现Runas自动输入密码,,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
在龙岗等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、网站制作 网站设计制作按需设计,公司网站建设,企业网站建设,品牌网站建设,营销型网站,外贸网站制作,龙岗网站建设费用合理。代码如下:
Set Shell = CreateObject("WScript.Shell") Shell.Run "cmd /c @runas /user:administrator CMD" WScript.Sleep 2000 Shell.SendKeys "password{ENTER}exit{ENTER}" WScript.Sleep 1000 Shell.SendKeys "@echo off&cls&net stop messenger&net start messenger&exit{ENTER}"
@echo off
echo dim WshShell,cmd >> %3runas.vbs
echo cmd="%SystemRoot%\system32\cmd.exe" >> %3runas.vbs
echo Set WshShell=WScript.CreateObject("WScript.Shell") >> %3runas.vbs
echo WshShell.Run cmd >> %3runas.vbs
echo WScript.Sleep 500 >> %3runas.vbs
echo WshShell.SendKeys"runas /user:Administrators\%1 %3Bcmd.bat" >> %3runas.vbs
echo WshShell.SendKeys"{ENTER}" >> %3runas.vbs
echo WScript.Sleep 1000 >> %3runas.vbs
echo WshShell.SendKeys"%2" >> %3runas.vbs
echo WshShell.SendKeys"{ENTER}" >> %3runas.vbs
echo WScript.Sleep 500 >> %3runas.vbs
echo WshShell.SendKeys"exit" >> %3runas.vbs
echo WshShell.SendKeys"{ENTER}" >> %3runas.vbs
echo @echo off >> %3Bcmd.bat
echo %4 %5 %6 %7 %8 %9 >> %3Bcmd.bat
echo del %3runas.vbs >> %3Bcmd.bat
echo del %3Bcmd.bat >> %3Bcmd.bat
%3\runas.vbs
以上保存为BAT
复制代码 代码如下:
dim WshShell,cmd
cmd="%SystemRoot%\system32\cmd.exe"
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run cmd
WScript.Sleep 500
WshShell.SendKeys"runas /user:Administrators\用户名 密码 命令"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys"%2"
WshShell.SendKeys"{ENTER}"
WScript.Sleep 500
WshShell.SendKeys"exit"
WshShell.SendKeys"{ENTER}"
以上保存为VBS
Runas
只有在通过自动登陆读到密码时才有用
以上是“VBS如何实现Runas自动输入密码,”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!