Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re: Reading the Windows Registry
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Reading the Windows Registry
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01636703
Message ID:
01636703
Vues:
163
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform