I use following code to create Windows registry entry.
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\Software\NewsReader\ConnectionString1", "Server=myServerName3\myInstanceName1;Database=myDataBase1;User Id=myUsername1;Password=myPassword1;", "REG_SZ"
Set WshShell = Nothing
Somehow it is writing in a wrong place.
HKEY_USERS\S-1-5-21-3289046681-1693842953-402210132-1123\Software\Classes\VirtualStore\MACHINE\SOFTWARE\NewsReader
I execute that script under admin domain account and also that account has Admin privileges locally.
What do I am missing here?
P.S. I found this Why is registry written in different location than expected? but it does not clear how I have to change my code...