Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using registry vcx
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Using registry vcx
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01262392
Message ID:
01262392
Views:
80
Hi All,
i can create key(s) in registry via WSH,
i want to also detect if key (parent key specially actually is not exist other ones no important to continiue for app.)
exist each time my app start .
i've tried to check if exist or not with sample TESTX key value via registry.vcx but i couldn't

how can i doit via WSH or registry vcx ?

TIA
Local WSHShell
WSHShell = Createobject("WScript.Shell")

*!*				Abbreviation                 Root Name
*!*	            HKCR                         HKEY_CLASSES_ROOT
*!*	            HKCU                         HKEY_CURRENT_USER
*!*	            HKLM                         HKEY_LOCAL_MACHINE
*!*	            HKU                          HKEY_USERS
*!*	            HKCC                         HKEY_CURRENT_CONFIG

*!*	*!* Create Registry Keys
*!*	WSHShell.Popup( "Create key HKCU\MyRegKey with value 'Top level key'")
*!*	WSHShell.RegWrite( "HKCU\MyRegKey\", "Top level key")

*!*	*!* Read Registry Keys
*!*	lcValue1 = WSHShell.RegRead("HKCU\MyRegKey\")
*!*	WSHShell.Popup("Value of HKCU\MyRegKey: " + lcValue1)

*!*	*!* Delete Registry Keys
*!*	WSHShell.Popup( "Delete value HKCU\MyRegKey\")
*!*	WSHShell.RegDelete( "HKCU\MyRegKey\")


WSHShell.RegWrite( "HKCU\TESTX\", "")
WSHShell.RegWrite( "HKCU\TESTX\P\Pabcdefghi", "")
WSHShell.RegWrite( "HKCU\TESTX\H\Habcdefghi", "")

Local TESTX,P,H
*m.TESTX = WSHShell.RegRead( "HKCU\TESTX\" )
m.TESTX = "HKCU\TESTX\"


If ! "registry.vcx" $ Set("CLASSLIB")
	Set Classlib To Home()+"ffc\REGISTRY.VCX" Additive
Endif
Local oReg
oReg=Newobject("registry")
oReg.iskey(m.TESTX,"")
Wait Window oReg  && result (object)  :(
Next
Reply
Map
View

Click here to load this message in the networking platform