How to change a value in the registry

Yes, I did search before asking [^] I need to change values in the registry in Navision code. Is there a standard windows dll or ocx I can use that exists in every Windows OS?

Erik, I never found one, but I did find many free components on the web to do so. There is an official MS control called regobj.dll which I have used. The control can be downloaded form this link: http://download.microsoft.com/download/vb60pro/update/6.0/w9x2k/en-us/regobji.exe Note: I figure there must be a pre-installed component in XP etc., otherwise how could Remote Installation work? But if MS offers this free control for VB6 programmers, then I had to assume there was no pre-installed control. Good Luck, john

You can use RegEdit to change the windows registry. on the command Prompt type RegEdit. This will open the Registry window, where you can change the registry entry for Navision as well. Make sure you know what you are doing before making any changes to the registry. Hope this will help. Naveen Jain

Oh, and one other thing … There is also a command-line program called regini.exe that might help (it’s on every 2K+) machine! -john

Thx for the help, I don’'t want to ask my users to install a lib so i’m still searching for a some lib included in the OS. Will research that regini … Open for suggestions[:p]

How about using Navision to create a text file with the extension .reg. On later versions of windows you can then load the .reg file with the reg.exe utility, use reg /? to see all the options or use google. After you are then you can then delete the .reg file again. Regards Meint

quote:

How about using Navision to create a text file with the extension .reg. On later versions of windows you can then load the .reg file with the reg.exe utility, use reg /? to see all the options or use google. After you are then you can then delete the .reg file again. Regards Meint http://www.petri.co.il/reg_command_in_windows_xp.htm gives some useful pointers
Originally posted by meintd - 2004 Oct 14 : 18:34:00

This is my solution and thank god I don’t need to place this in [V] code tags: //Name-DataType-Subtype-Length //LatmWshShell-Automation-‘Windows Script Host Object Model’.WshShell- //LvVAR1-Variant-- //LvVAR2-Variant-- //LvVAR3-Variant-- //LvValue-Variant-- CREATE(LatmWshShell); LvVAR1 := ‘HKCU\Environment\TEST’; LvVAR2 := ‘blablabla’; LvVAR3 := ‘REG_SZ’; //Write LatmWshShell.RegWrite(LvVAR1, LvVAR2, LvVAR3); //Read LvValue := LatmWshShell.RegRead(LvVAR1); MESSAGE(FORMAT(LvValue)); CLEAR(LatmWshShell); Ok, in code tags then: //Name-DataType-Subtype-Length //LatmWshShell-Automation-'Windows Script Host Object Model'.WshShell- //LvVAR1-Variant-- //LvVAR2-Variant-- //LvVAR3-Variant-- //LvValue-Variant-- CREATE(LatmWshShell); LvVAR1 := 'HKCU\Environment\TEST'; LvVAR2 := 'blablabla'; LvVAR3 := 'REG_SZ'; //Write LatmWshShell.RegWrite(LvVAR1, LvVAR2, LvVAR3); //Read LvValue := LatmWshShell.RegRead(LvVAR1); MESSAGE(FORMAT(LvValue)); CLEAR(LatmWshShell);

Erik, What OS are you using? I have XP pro, and don;t have the Script Host installed by default ?!? -john

I have XP PRO and just checked on an old machine W98. It worked also. Started vmware with a blank XP OS and worked. Where do you get the option to not install WSH in XP?