randallc Posted June 11, 2007 Share Posted June 11, 2007 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
MaineGeek Posted June 11, 2007 Share Posted June 11, 2007 (edited) 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 June 11, 2007 by MaineGeek Link to comment Share on other sites More sharing options...
randallc Posted June 11, 2007 Author Share Posted June 11, 2007 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Siao Posted June 12, 2007 Share Posted June 12, 2007 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, RandallWhat he said is thatHKEY_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" Link to comment Share on other sites More sharing options...
MaineGeek Posted June 12, 2007 Share Posted June 12, 2007 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. Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2007 Author Share Posted June 12, 2007 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2007 Author Share Posted June 12, 2007 (edited) 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, RandallMore 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 June 12, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
/dev/null Posted June 12, 2007 Share Posted June 12, 2007 (edited) More specifically, is the return "REG_NONE" from $RegRead2 = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer", "IconUnderline") Cheers Kurt Edited June 12, 2007 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 * Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2007 Author Share Posted June 12, 2007 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
/dev/null Posted June 12, 2007 Share Posted June 12, 2007 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 * Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2007 Author Share Posted June 12, 2007 Hi, Then it always answres "Singleclick" Consider these results; $doubleclick1=21 $doubleclick2=0x21 BitAnd($doubleclick1,0x20)=0 BitAnd($doubleclick2,0x20)=32from$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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted June 12, 2007 Author Share Posted June 12, 2007 (edited) Just for posterity, I think the correct read here is; $doubleclick2 = "0x" & $bytes[9] & $bytes[10]ie no "hex" required as they are already hex values Best, Randall Edited June 12, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now