找回密码
 加入
搜索
查看: 1850|回复: 0

[AU3基础] 代码如何取消弹出输入管理账户和密码对话框

[复制链接]
发表于 2016-6-28 16:19:21 | 显示全部楼层 |阅读模式
以下代码只要在管理员运行,就不会出现截图中弹出对话框,在普通的账户下运行就出现截图中的对话框,以下的代码,如何设置才能普通的用户运行该脚本,不会有截图中的弹出对话框。
#RequireAdmin

if $cmdline[0]>0 then
Select
     Case $cmdline[1]="/s"
             reg()

                  _Update_Explorer()
                  Exit
         Case $cmdline[1]="/s1"
                  reg()

                  Exit

         Case $cmdline[1]<>"/s" And $cmdline[1]<>"/s1"
                 MsgBox(262144,"提示","运行参数错误!正确的是参数为/S或/S1")

                 Exit

        EndSelect
EndIf
;-------------------------------无参数运行
reg()

         _Update_Explorer()
MsgBox(262144,"提示","WIN7 IE桌面图标创建完毕!")
;-------------------------------无参数运行结束

Func _Update_Explorer()

    Local $bOld = Opt("WinSearchChildren", True)

    Local $a = WinList("[CLASS:SHELLDLL_DefView]")

    For $i = 0 To UBound($a) - 1

        DllCall("user32.dll", "long", "SendMessage", "hwnd", $a[$i][1], "int", 0x111, "int", 28931, "int", 0)

    Next

    Opt("WinSearchChildren", $bOld)

EndFunc;==>_Update_Explorer

Func reg()

RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-100000000001}')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-100000000001}', '', 'REG_SZ', 'Internet Explorer')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}', '', 'REG_SZ', 'Internet Explorer')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\DefaultIcon')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\DefaultIcon', '', 'REG_SZ', '' & @SystemDir & '\ieframe.dll,-190')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell', '', 'REG_SZ', '')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\NoAddOns')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\NoAddOns', '', 'REG_SZ', '无加载项启动(&N)')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\NoAddOns\Command')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\NoAddOns\Command', '', 'REG_SZ', '"C:\Program Files\Internet Explorer\iexplore.exe" -extoff')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Open')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Open', '', 'REG_SZ', '打开主页(&H)')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Open\Command')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Open\Command', '', 'REG_SZ', '"C:\Program Files\Internet Explorer\iexplore.exe"')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Set')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Set', '', 'REG_SZ', '属性(&R)')

RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Set\Command')
RegWrite('HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-100000000001}\\shell\Set\Command', '', 'REG_SZ', '"' & @SystemDir & '\rundll32.exe" ' & @SystemDir & '\shell32.dll,Control_RunDLL ' & @SystemDir & '\inetcpl.cpl')

EndFunc

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

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

本版积分规则

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

GMT+8, 2024-12-22 21:24 , Processed in 0.074644 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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