VBS Runas automatically enter password, plaintext _vbs

Source: Internet
Author: User
Tags sleep
Copy Code code as follows:

Set Shell = CreateObject ("Wscript.Shell") shell.run "cmd/c @runas/user:administrator cmd" wscript.sleep Eys "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 >>%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 >>%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
Above Save As Bat
Copy Code code 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} '
Save As VBS above

Runas
Only useful if you read the password by automatically logging in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.