I have the following code that runs on Server 2003 and Server 2008. It will read the key in the registry otherwise it will create it if it does not exist.
LOCAL loWSH As wscript.Shell
loWSH = Createobject("wscript.shell")
TRY
MESSAGEBOX(loWSH.RegRead('HKLM\SOFTWARE\Talk\Default Printer\myname\'))
CATCH TO oErr
IF oErr.ErrorNo = 1429
loWSH.RegWrite('HKLM\SOFTWARE\Talk\Default Printer\myname\', 'Lexmark', "REG_SZ")
ENDIF
ENDTRY
However, when I run this on Server 2012R2 it does not create the key in the specified location.
Instead it right to
HKEY_USERS\S-1-5-21-1004336348-813497703-1708537768-1122\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Wow6432Node\Talk\Default Printer\myname
Why is this happening?
How can I get to right the key to the location specified.
I have several programs that I need to convert to run on server 2012 R2
Thanks in advance
Stuart Reid
True nobility lies not in being superior to another man, but in being superior to one’s previous self