Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re: Reading the Windows Registry
Message
From
23/05/2016 05:35:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Reading the Windows Registry
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01636703
Message ID:
01636703
Views:
162
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
Next
Reply
Map
View

Click here to load this message in the networking platform