StrokesPlus Forum
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Feature Updates
 Completed Requests
 [COMPLETE] Read/Write Windows Registry Keys

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

Check here to subscribe to this topic.

T O P I C    R E V I E W
breakcore Posted - 11/01/2012 : 06:46:10
Currently I have registry involved actions done by autoit scripts which are running by S+ gestures. But this way is a little slow, so I'm thinking may be it's possible to implement those scripts right in the S+. Does lua script (or alien) capable of reading/writing the windows registry key values?

8   L A T E S T    R E P L I E S    (Newest First)
Hard.Wired Posted - 05/09/2019 : 09:17:19
Thanks, I'll look into these possibilities.
Rob Posted - 05/09/2019 : 08:20:36
Even if you're running the signed version, but not as Administrator, S+ won't have access to that registry key. Now, that's because the code class I brought into S+ attempts to open the registry key via RegOpenKeyEx passing KEY_ALL_ACCESS, so it fails.

In looking at the reg class, it does have read access calls, but on my function I'm first trying to set the key (open for access) before trying to read the values, that SetKey call uses the KEY_ALL_ACCESS, but it seems that check just shouldn't be there.

Back when I added this, I don't think I had all of the signed stuff going on, so I only ran as admin and pretty much assumed most people did, especially if they wanted to access system things. Not that it excuses this oversight, but at least serves to explain it :)

I tried to see if this could be done via alien call in Global Lua, but it seems rather complicated and I'm not sure how to make it work.

However, you can probably use this as a workaround, you will probably need to do a little parsing/cleaning of the string..but that should be pretty easy:
local version = acGetFileVersion(acExpandEnvironmentString("%windir%").."\\explorer.exe", nil, gsx, gsy) 
acMessageBox(version, "Windows Version")

Hard.Wired Posted - 05/09/2019 : 07:48:11
I've been trying to get some registy values in Windows 10, but no joy... e.g.

qf_sRegistryWindowsVerson = acRegistryGetNumber(2, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "CurrentMajorVersionNumber", "0")

What am I missing?

breakcore Posted - 11/04/2012 : 15:11:06
I've been waiting for this, Thank you!
Rob Posted - 11/04/2012 : 14:06:55
Added some basic registry functions in 2.3.8.

acRegistryDeleteKey (will not delete if subkeys exist)
acRegistrySetNumber (stores as DWORD)
acRegistryGetString (supports REG_SZ and REG_EXPAND_SZ)
acRegistrySetString (supports REG_SZ and REG_EXPAND_SZ)

Note that you may encounter issues with these if you are not running S+ with administrator privileges or are running with conflicting platforms, such as 32-bit S+ and 64-bit Windows.

I realize there are some limitations, but I didn't want to go overboard; just wanted to get the basics in there. I'll revisit and further enhance in the future based on what people need or issues encountered.
breakcore Posted - 11/01/2012 : 11:23:18
And while we on todo list, don't you think the script field font size is unreasonably big?
this forum, on the other hand, has a perfect code size
breakcore Posted - 11/01/2012 : 10:54:55
This is great!!!
Rob Posted - 11/01/2012 : 10:36:31
Actually, it's probably ok here since there are no actions which assist in reading/writing registry values.

I'll add that to my todo

acSetRegistryKey (update or create if doesn't exist)
acSetRegistryValue (update or create if doesn't exist)
acGetRegistryKey (not sure about this one, as far as returning a whole key..I'll think it through)
acGetRegistryValue (get a value)

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000