Jump to content
Sign in to follow this  
randallc

enum registry headings

Recommended Posts

randallc

Hi,

It seems on different computers that the key name looking for Windws settings under hku vary, so need hard coding;

$RegRead2=RegRead("HKEY_USERS\S-1-5-21-4073353386-3284283900-1182343958-1005\Software\Microsoft\Windows\CurrentVersion\Explorer","ShellState")
;'[HKEY_USERS.Default\Software\Microsoft\Windows\CurrentVersion\Explorer]"ShellState"=hex:1c,00,00,00,41,08,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0,00,00,00,09,00,00,00"IconUnderline"=hex(0):03,00,00,00 
ConsoleWrite("@EXTENDED="&@EXTENDED&@LF)
if $RegRead2="2400000053080000000000000000000003000000FFFFFFFF0D0000000000000002000000" then 
    ConsoleWrite("Single Click="&$RegRead2&@LF)
elseif $RegRead2="2400000073080000000000000000000003000000FFFFFFFF0D0000000000000002000000" then 
    ConsoleWrite("Double Click="&$RegRead2&@LF)
Else
    ConsoleWrite("???? Click="&$RegRead2&@LF)
    
EndIf

Does anyone know how to do this?

eg, this script works on 1 computer, but not on any other as the registry [4073353386-3284283900-1182343958-1005] is different?

any other way to do this?

Bst, Randall

Share this post


Link to post
Share on other sites
MaineGeek

Yeah the users id will be different for each user (SID). If the user is logged in when your running the script then go after HKEY_CURRENT_USER instead of HKEY_USERS. HKEY_CURRENT_USER (or HKCU) will point you to the users HKU\S-11150-1122... key.

Edited by MaineGeek

Share this post


Link to post
Share on other sites
randallc

Yeah the users id will be different for each user (SID). If the user is logged in when your running the script then go after HKEY_CURRENT_USER instead of HKEY_USERS. HKEY_CURRENT_USER (or HKCU) will point you to the users HKU\S-11150-1122... key.

Thanks, but I am not knowledgeable in ths area; what key do I request here?

Do I need to know the @ComputerName @UserName; and , if so, is there such a generic key to find that "HKU\S-11150-1122... key"?

Can you show me an example script?

TIA, Randall

Share this post


Link to post
Share on other sites
Siao

Thanks, but I am not knowledgeable in ths area; what key do I request here?

Do I need to know the @ComputerName @UserName; and , if so, is there such a generic key to find that "HKU\S-11150-1122... key"?

Can you show me an example script?

TIA, Randall

What he said is that

HKEY_CURRENT_USER branch is the same as HKEY_USERS\S-1-5-21-4073353386-3284283900-1182343958-1005 branch if the user S-1-5-21-4073353386-3284283900-1182343958-1005 is logged in.

So just replace the latter with the former:

$RegRead2=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer","ShellState")

Got it?


"be smart, drink your wine"

Share this post


Link to post
Share on other sites
MaineGeek

Sorry Randall, just learning AutoIt... BUT I do know the Windows Registry to some extent.

You were using:

"HKEY_USERS\S-1-5-21-4073353386-3284283900-1182343958-1005\Software\Microsoft\Windows\CurrentVersion\Explorer","ShellState"

Try this instead:

"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer","ShellState"

Just open up regedit and find your way there. Think of HKCU as a short cut to HKU\S-123443..... BUT only for the currently logged in user.

If this script is being executed locally then you shouldn't need @ComputerName or @UserName. I'm not sure how well my method will work if it is run remotely.

Share this post


Link to post
Share on other sites
randallc

OK!

Thanks to you both!

I now have another problem; I can read the key, but it is also not what I need to be reading on this computer for that setting of "Single Click" mode or "DoubleClick" mode; the key itself may be an array or something, or I need to read subparts of the binary answer to get what I need?

any idea?

Tahnks, Randall

Share this post


Link to post
Share on other sites
randallc

OK!

Thanks to you both!

I now have another problem; I can read the key, but it is also not what I need to be reading on this computer for that setting of "Single Click" mode or "DoubleClick" mode; the key itself may be an array or something, or I need to read subparts of the binary answer to get what I need?

any idea?

Tahnks, Randall

More specifically, is the return "REG_NONE" from

$RegRead2 = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer", "IconUnderline")
with @extended=0 a hex/ binary answer?

Why do I get an empty answer?, or how else do I find if that =="03 00 00 00"? [as it reads in Regedit]

No; that is wrong.

The only changes are in ShellState;

1 machine from

; on D9150; "2400000053080000000000000000000003000000FFFFFFFF0D0000000000000002000000" Single

; on D9150; "2400000073080000000000000000000003000000FFFFFFFF0D0000000000000002000000" Double

Another from

; on ACERLAP; "2400000013280000000000000000000000000000010000000D0000000000000002000000" Single

; on ACERLAP; "2400000033280000000000000000000000000000010000000D0000000000000002000000" Double

Best, randallThe 9th didgit increments by 2!; but not the same on each....[

Edited by randallc

Share this post


Link to post
Share on other sites
/dev/null

More specifically, is the return "REG_NONE" from

$RegRead2 = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer", "IconUnderline")

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
/dev/null

Hi,

Thanks so much ; it works!

Although i had to change it to;

$doubleclick = "0x"&Hex($bytes[9] & $bytes[10],2)
Is that expcted or a bug with "hex"?

Best,randall

it should not be necessary to prepend 0x . What happens if you don't do that?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
randallc

Hi,

Then it always answres "Singleclick"

Consider these results;

$doubleclick1=21

$doubleclick2=0x21

BitAnd($doubleclick1,0x20)=0

BitAnd($doubleclick2,0x20)=32

from
$RegRead2 = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer", "ShellState")
$bytes = StringSplit($RegRead2, "")
$doubleclick1 = Hex($bytes[9] & $bytes[10],2)
$doubleclick2 = "0x" & Hex($bytes[9] & $bytes[10], 2)
ConsoleWrite("$doubleclick1=" & $doubleclick1 & @LF)
ConsoleWrite("$doubleclick2=" & $doubleclick2 & @LF)
ConsoleWrite("BitAnd($doubleclick1,0x20)=" & BitAND($doubleclick1, 0x20) & @LF)
ConsoleWrite("BitAnd($doubleclick2,0x20)=" & BitAND($doubleclick2, 0x20) & @LF)
Randall

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×