找回密码
 加入
搜索
查看: 2522|回复: 5

[AU3基础] (已解决)使用runas无法正常使用管理员模式登录

[复制链接]
发表于 2011-9-16 11:14:37 | 显示全部楼层 |阅读模式
本帖最后由 xyhqqaa 于 2011-10-19 14:49 编辑

本人平时在公司用域账号登录,但是有时候要使用管理员登录。但是想使用ruaas的时候可以正常打开但就是无法以管理员方式登录。新手,刚学不久,求助。俺不是伸手党。。囧
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
Local $username="administrator"
Local $password="123"
$Form1 = GUICreate("Form1", 367, 66, 192, 114)
$input=GUICtrlCreateInput("", 0, 16, 249, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Button1", 272, 16, 73, 25)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1        
                        $computer=_RunDos("compmgmt.msc/computer="&GUICtrlRead($input))
                                RunAs($username,"",$password,1,$computer)
                        EndSwitch
WEnd
就是runas的使用不熟悉。虽然调用出来了compmgmt.msc,但是并不是管理员模式。,也就是下面那个RunAs($username,"",$password,1,$computer)
是没效果的。但是不知道该怎么修改才行
 楼主| 发表于 2011-9-16 11:26:26 | 显示全部楼层
自己顶。。希望有人看到帮忙解答下
发表于 2011-9-16 15:33:52 | 显示全部楼层
RunAs ( "用户名", "域名", "密码", 登录标志, "程序" [, "工作目录" [, 显示标志 [, 可选标志 ]]] )

俺也是菜鸟。。帮你顶等高手出现!不过多看看帮助!
 楼主| 发表于 2011-9-18 16:49:30 | 显示全部楼层
囧..就这样沉了呀............
发表于 2011-9-19 14:36:32 | 显示全部楼层
帮顶拿分走人...
发表于 2011-9-22 23:59:24 | 显示全部楼层
$computer改成mmc.exe compmgmt.msc /computer=computerName

评分

参与人数 1金钱 +10 收起 理由
xyhqqaa + 10 谢谢。。测试可用

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 15:14 , Processed in 0.082114 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表