日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

可以自动输入密码的Runas

發布時間:2023/12/15 综合教程 29 生活家
生活随笔 收集整理的這篇文章主要介紹了 可以自动输入密码的Runas 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一 Runas

在使用批處理實現自動化的工程中,我們也許會遇到某些操作必須要在擁有權限的某個用戶下才能執行。但是這時windows自帶的Runas在批處理中調用時不能完成自動輸入密碼。 這時需要使用免費的第三方工具:

1)lsrunas (http://www.moernaut.com/default.aspx?item=lsrunas)

LSrunas can be used to run a command using another user account and passing the password as a parameter

Parameters:
-----------
/user: specifies the username
/password: specifies the password
/domain: specifies the domain
/command: specifies the command to execute and the parameters
/runpath: specifies the path where the command should start

Examples:
---------
lsrunas /user:administrator /password:s3cr3tp@ssw0rd /domain:Mydomain /command:notepad.exe /runpath:c:\

lsrunas /user:administrator /password:s3cr3tp@ssw0rd /domain:Mydomain /command:"C:\Program Files\Internet Explorer\iexplore.exe" /runpath:c:\

lsrunas /user:administrator /password:s3cr3tp@ssw0rd /domain:Mydomain /command:"C:\Program Files\Internet Explorer\iexplore.exe http://www.google.cn" /runpath:c:\

2)sanur (http://www.commandline.co.uk/sanur_unsupported/index.html)

Sanur is a tiny Win32 console utility that 'pipes' a password into the Windows 2000/XP/2003 Runas utility, thereby making Runas scriptable.

Usage
Pipe your normal Runas commandline into Sanur and specify the password on Sanur's commandline or use the /i switch to have Sanur read the password from a file:-

RUNAS <options> | SANUR password
RUNAS <options> | SANUR /i [drive:][path]filename

In otherwords, just add | SANUR password to the end of your working Runas command.

Examples
Pipe the password 'pa55w0rd' into Runas:
runas /u:domain\username program.exe | sanur pa55w0rd

Pipe the password from the file named password.txt into Runas:
runas /u:domain\username program.exe | sanur /i password.txt

Same as above but any Runas errors, such as a logon failure, will be displayed:
runas /u:domain\username program.exe >&2 | sanur /i password.txt

二使用shellrunas來為windows增加右鍵使用不同的用戶來運行程序。

SysinternalsSuite-ShellRunas - Launch programs as a different user via a convenient shell context-menu entry.

完!

作者:iTech
微信公眾號: cicdops
出處:http://itech.cnblogs.com/
github:https://github.com/cicdops/cicdops

總結

以上是生活随笔為你收集整理的可以自动输入密码的Runas的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。