a000000 发表于 2016-11-18 08:30:25

关于注册表动态路径S-1-5-21xxxxxx,如何获取这个路径?

本帖最后由 a000000 于 2016-11-18 08:33 编辑

为了做静默去广告的360极速浏览器,别的都处理好了,唯一最后这个设置首页问题过不去了,研究后发现他需要修改注册表:


"homepage"="aHR0cHM6Ly93d3cuYmFpZHUuY29tL3tmOTVhMWI3Y2Y3NTQxNWQwNWQ3ODE1OWJiNDNkMTE5Mn17YjZhZjA0YWRlZGRmYWJlODJiNDFkNjRkOTY4N2MxZWR9"


可是路径中“S-1-5-21-3399403695-1167166691-220441381-500”在不同的电脑中显示的不同,翻阅了n多帖子、帮助文件,百度......均无法找到答案,只知道这个地方是根据系统的sid(估计是硬件什么的不同自动生成的)

请大侠帮忙。多谢

jtyuer 发表于 2016-11-18 10:16:29

#Include <Security.au3>
#include <array.au3>
$array=_Security__LookupAccountName(@UserName)
MsgBox(0,'',$array)

jtyuer 发表于 2016-11-18 10:17:22

LZ试试看,系统自带的

a000000 发表于 2016-11-18 10:58:51

本帖最后由 a000000 于 2016-11-18 11:04 编辑

回复 3# jtyuer

D:\Documents and Settings\Administrator\Desktop\新建 AutoIt v3 脚本 (2).au3(33,47) : 错误: 表达式错误
$array=_Security__LookupAccountName(@UserName)[
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Documents and Settings\Administrator\Desktop\新建 AutoIt v3 脚本 (2).au3 - 1 error(s), 0 warning(s)
9-2009 J


是我版本不对还是别的有地方不对?这是运行后出现的错误提示

a000000 发表于 2016-11-18 11:12:51

非常感谢,版本问题,升级到最新版本后好了,多谢jtyuer,获取非常正确!

lin6051 发表于 2016-11-18 13:11:44

回复 5# a000000


    #Include <Security.au3>
$array=_Security__LookupAccountName(@UserName)
MsgBox(0,'',$array)

老版本应该这样吧

jtyuer 发表于 2016-11-25 08:12:25

回复a000000


    #Include
$array=_Security__LookupAccountName(@UserName)
MsgBox(0,'',$arra ...
lin6051 发表于 2016-11-18 13:11 http://www.autoitx.com/images/common/back.gif

解决了就好,我也是随手写了一下,示意而已

13gu 发表于 2016-11-25 22:11:24

请问一下具体怎么写,没看懂

q410225 发表于 2016-12-10 11:28:44

学习了,原来可以如此表达

chishingchan 发表于 2016-12-10 16:38:28

变量 $SID 就是你想要的结果:$wshNetwork = ObjCreate("WScript.Network")
$objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_Account")
For $objItem In $colItems
        If $objItem.Name = $wshNetwork.UserName Then
                $SID = $objItem.SID
        EndIf
Next

q410225 发表于 2016-12-10 18:56:18

献丑啦,我也来个笨办法,通用性最低的


Local $sSubKey
For $i = 1 To 10
        $sSubKey = RegEnumKey("HKU", $i)
        If @error Then ExitLoop
        FileWrite(@ScriptDir&"\reg.txt",$sSubKey&@CRLF)
Next
Local $_a=FileRead(@ScriptDir&"\reg.txt")
Local $_c=stringRegExp($_a,"\w\-\d\-\d\-\d+\-\d+\-\d+\-\d+\-\d+",3)
If @error Or UBound($_c) < 1 Then MsgBox(0,"",@error)
MsgBox(0,"",$_c)
页: [1]
查看完整版本: 关于注册表动态路径S-1-5-21xxxxxx,如何获取这个路径?