Manipulating windows Registry by lotusscript

I have seen many posts in Lotus Notes 6 and 7 forum and other places asking how to add or remove values in windows registry using lotusscript. The solutions suggested usually involve many lines of code and knowledge of windows APIs. After some thought, I found a simpler way to achieve the same thing and I thought I would share it here.

The solution is simple; just use windows built-in REG command. Below is an example, where I enable font smoothing through the registry in the postopen even of my database:

Dim intResult as Integer
intResult = Shell ({REG ADD “HKCU\Control Panel\Desktop” /v FontSmoothing /t REG_SZ /d 2 /f})

The code above should be self-explanatory. It changes the value of FontSmoothing key in HKEY_CURRENT_USER\ControlPanel\Desktop to value of 2.

Using the same method, you can do anything with the registry. Simply go to your command prompt and type “REG /?” without quotes to get a list of available commands.

Leave a Reply