TCL Registry Package

Posted by andremx on 2014-08-02 22:26
Forums: TEA discussions | OS: Windows 7

Dear Everyone,

I have a problem with registry package. Now, I am using tcl 8.3, reg v1.0 and win7 64bit and administrator access. I am using program that has Tcl built into it. I have tried changed or replaced the latest version (8.3.x/8.4/8.5/....) but still does not work. Just let you know that I can using for package get and delete but failed if using keys, set, type and values package. Please follow the script below;

#==========================================================
package require registry 1.0
set regPath {HKEY_LOCAL_MACHINE\SOFTWARE\TESTS}
registry set $regPath "dataname" "valuecontent" sz

set curPath [registry get $regPath "otherdataname"]
puts "$curPath"
#==========================================================

If you

The error message below;
---------------------------------------------------------
Warning: Tcl generated error at line 3:
unable to open key: Invalid access to memory location.
while executing
"registry set $regPath "dataname" "valuecontent" sz"
(file "registry.tcl" line 3)
invoked from within
"default_source "testreg.tcl""
---------------------------------------------------------

I have tried but still fail. Please let me know that I would like to make a KEY, STRING and DWORD. What should the codes?
Example;

package require registry 1.0
set regPath {HKEY_LOCAL_MACHINE\SOFTWARE\TESTS}
What next scripts...

I needed your help please.

Thank you

Regards,
Andre

grahams
ActiveState Staff
Tue, 2014-08-05 10:39

Registry 1.0 has no support for 64-bit systems with dual Registries.
http://www.tcl.tk/cgi-bin/tct/tip/362.html

Tcl 8.3 is obsolete. Many versions of 8.4 and some versions of 8.5 do not support Windows 7. 8.6 is a better bet. but even then, some operations will require that you run in a cmd window that has been started using a right-click and "Run as Administrator" - even if you are an Administrator.

andreamincos | Mon, 2015-03-30 23:31

Hi Graham,

I am still dont understand. Could you show me an example please?!

Much Thanks!

Regards,
Andre