Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RegOpenKey & RegDeleteKey
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00754071
Message ID:
00754415
Views:
23
>try with this
>CreateObject("WScript.Shell")
>and you can download the help file from Ms:
>http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/728/msdncompositedoc.xml
>that work very fine.

There are a couple of problems with using the Windows Script Host to read and write registry values. First, the WSH must be installed. While it is installed with Win2K, in earlier versions of Win32 it wasn't necessarily. In order to check if it was (in, for example, a post-setup executable), the best way to check was to see if the VBScript.RegExp key under HKEY_CLASSES_ROOT existed. This told you that the most recent version of the WSH (2.0) was installed or not. In order to do this, you had to use something like the registry class that's in the FFC.

The other reason was that error handling is more difficult. In a script file, any errors would show up in the Err object, which isn't available from within VFP.

For these reasons, when the late Ed Rauh and I wrote about the WScript.Shell object in the October, 2000 issue of the VFUG newsletter (www.vfug.org), we omitted this capacity of the WScript.Shell object, and concentrated instead on things like the Run, SendKeys methods and the shortcut object.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform