Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sample code to delete registry keys.
Message
From
05/06/2002 12:13:47
 
 
To
05/06/2002 11:55:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00664517
Message ID:
00665012
Views:
22
Andrus,

As Plamen mentioned, you can use API functions:
*-- deletes a key from the registry
declare integer RegDeleteKey in Win32API ;
    integer nHKEY,  string  cKey 

*-- deletes a value from a key
declare integer RegDeleteValue in Win32API ;
    integer nHKEY,  string cValueName
>Daniel,
>
>thank you for reply.
>I my knowledge, many users don't have wsh installed.
>I'm looking for a solution which works in all computers where vfp application
>can be installed.
>Is it possible delete key using VFP only ?
>
>
>>Andrus,
>>You could use the WSH:
>>
>>owsh=CREATEOBJECT("wscript.shell")
>>owsh.RegDelete("KeyOrValueToDelete")
>>
>>If the argument ends with a backslash, then it's treated as a key, otherwise as a value. I think you'll have to delete each key individually.
>>
>>Use at your own risk ;-)
>>
>>>I have the folowing key in registry:
>>>
>>>HKEY_CLASSES_ROOT\Installer\Products\D4630248E9E66D11E8F400008E6D868E
>>>
>>>This key contains 7 leaves: Client, Language, ProductName, Version etc.
>>>
>>>Is it possible to write VFP 7 code to remove this key and all its leaves ?
>>>
>>>Is it possible to use a singe command to remove a key with all leaves or
>>>must I remove all subkeys reparately ?
>>>
>>>Here are the all keys which I want to remove:
>>>
>>>
>>>REGEDIT4
>>>
>>>[HKEY_CLASSES_ROOT\Installer\Products\D4630248E9E66D11E8F400008E6D868E]
>>>"ProductName"="My Application.msi"
>>>"PackageCode"="C1730248E9E66D11E8F400008E6D868E"
>>>"Language"=dword:00000409
>>>"Version"=dword:00000000
>>>"Assignment"=dword:00000001
>>>"AdvertiseFlags"=dword:00000184
>>>"Clients"=hex(7):3a,00,00
>>>
>>>[HKEY_CLASSES_ROOT\Installer\Products\D4630248E9E66D11E8F400008E6D868E\SourceList]
>>>"PackageName"="My Application.msi"
>>>"LastUsedSource"=hex(2):6e,3b,31,3b,43,3a,5c,57,49,4e,44,39,38,5c,54,45,4d,50,\
>>>  5c,5f,69,73,33,31,36,33,5c,00
>>>
>>>[HKEY_CLASSES_ROOT\Installer\Products\D4630248E9E66D11E8F400008E6D868E\SourceList\Net]
>>>"1"=hex(2):43,3a,5c,57,49,4e,44,39,38,5c,54,45,4d,50,5c,5f,69,73,33,31,36,33,\
>>>  5c,00
>>>
>>>[HKEY_CLASSES_ROOT\Installer\Products\D4630248E9E66D11E8F400008E6D868E\SourceList\Media]
>>>"DiskPrompt"="[1]"
>>>"1"="DISK1;1"
>>>
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform