dos_regsetstr

dos_regsetstr

Anonymous
Not applicable
899 Views
5 Replies
Message 1 of 6

dos_regsetstr

Anonymous
Not applicable

Hi,

please dos_getsetstr can not write in HKEY_LOCAL_MACHINE that returns each time nil yet in the help it is well noted that it can do that.

 

dos_regsetstr.png

 

Thanks for your help

0 Likes
900 Views
5 Replies
Replies (5)
Message 2 of 6

ronjonp
Advisor
Advisor

Just guessing, but you probably don't have the correct permissions set to write there.

Message 3 of 6

ronjonp
Advisor
Advisor

See if this writes the test key to the HKLM .. it would only do it on my computer when I gave 'Everyone' full control.

(if (setq ws (vlax-get-or-create-object "WScript.Shell"))
  (vlax-invoke ws 'regwrite "HKEY_LOCAL_MACHINE\\TestKey" 1 "REG_DWORD")
)

image.png

 

0 Likes
Message 4 of 6

Anonymous
Not applicable

Well, it was due to permissions

Thanks for your help

0 Likes
Message 5 of 6

ronjonp
Advisor
Advisor

Glad to help 🙂

0 Likes
Message 6 of 6

Anonymous
Not applicable

This code

(if (setq ws (vlax-get-or-create-object "WScript.Shell"))
  (vlax-invoke ws 'regwrite "HKEY_LOCAL_MACHINE\\TestKey" 1 "REG_DWORD")
)

 causes error exception.

me too when I give everyone the total control it works

thanks

 

0 Likes