How to input password automatically in Runas by VBS
This article mainly introduces VBS how to achieve Runas automatic password input, the article is very detailed, has a certain reference value, interested friends must read it!
The code is as follows:
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
The above is saved as BAT
The copy code is as follows:
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\ username password command"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys'2'
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "exit"
WshShell.SendKeys "{ENTER}"
The above is saved as VBS
Runas
It is only useful when reading the password through automatic login
The above is "VBS how to achieve Runas automatic password input," all the content of this article, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!