找回密码
 加入
搜索
查看: 5272|回复: 7

[系统综合] [已解决]域用户下使用runas调用注册表后添加值?

  [复制链接]
发表于 2011-4-8 01:50:39 | 显示全部楼层 |阅读模式
本帖最后由 xyhqqaa 于 2011-4-17 21:42 编辑

新手,我想在域用户登录的情况下使用管理员账号来调用regedit。然后再添加注册信息。但是使用runas时候。在管理员账户下。可以正常调用添加,但在域用户下却没反应,求解。
Local $sUserName = "administrator"
Local $sPassword = "123"
RunAs($sUserName, @ComputerName, $sPassword, 0, $b, @WindowsDir&"\regedit.exe")
FileCreateShortcut($c, "C:\Documents and Settings\All Users\「开始」菜单\程序\ESET\ESET NOD32 Antivirus\ESET NOD32  Antivirus.lnk", @ScriptDir)
regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","egui.exe","REG_SZ",$a)
发表于 2011-4-8 08:45:04 | 显示全部楼层
占个沙发,学习一下
 楼主| 发表于 2011-4-10 12:13:55 | 显示全部楼层
没人看0 0
 楼主| 发表于 2011-4-10 12:13:59 | 显示全部楼层
没人看0 0
 楼主| 发表于 2011-4-10 12:14:33 | 显示全部楼层
自己顶下。。。。。。求助呀
发表于 2011-4-10 16:38:06 | 显示全部楼层
下面是我写的授权安装软件,你参考参考

其实你的要求没必要这么搞,既然有管理员权限,后台搞完全可以
e <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("授权安装小工具", 348, 157, 192, 124)
$Input1 = GUICtrlCreateInput("", 136, 24, 177, 21)
$Label1 = GUICtrlCreateLabel("要安装文件的路径", 8, 24, 132, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Input2 = GUICtrlCreateInput("", 112, 72, 65, 21)
$Input3 = GUICtrlCreateInput("", 248, 72, 65, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$Label2 = GUICtrlCreateLabel("管理员账号", 16, 72, 84, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("密码", 192, 72, 36, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("安装", 248, 112, 65, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $file = GUICtrlRead($Input1)
        $name = GUICtrlRead($Input2)
        $password = GUICtrlRead($Input3)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1
                        RunAs($name,"assa-wh.com",$password,4,$file)
        EndSwitch
WEnd
 楼主| 发表于 2011-4-13 00:12:58 | 显示全部楼层
下面是我写的授权安装软件,你参考参考

其实你的要求没必要这么搞,既然有管理员权限,后台搞完全可以
502762378 发表于 2011-4-10 16:38

谢谢。试试学习下。。万分感谢,但是文件路径需要自己自己填写,有点麻烦。。新手只要好好学习。。先理解你的思路先
发表于 2011-4-13 08:19:23 | 显示全部楼层
回复 7# xyhqqaa


    我这是没办法,要求安装的东西在网络路径;打开都要验证,
你要想直接打开可以用FileOpenDialog
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 08:23 , Processed in 0.083502 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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