Página 1 de 1

Sample for registry key

Publicado: Sab Oct 21, 2006 7:51 am
por Srdjan
Please send any sample for create registry key.
For example this function
RegWrite("HKLMSOFTWAREYourKeyYourName", "YourValue", "REG_SZ" )

Sample for registry key

Publicado: Mar Oct 24, 2006 11:20 am
por jfgimenez
Srdjan,
> Please send any sample for create registry key.
>
> For example this function
>
> RegWrite("HKLMSOFTWAREYourKeyYourName", "YourValue", "REG_SZ" )
Here you are a real sample made by Ignacio long time ago that reads and
writes in the registry (it disables the windows' oportunistic lock):
FUNCTION SetNetworkClientScheme()
With Object TRegistry():New()
:Root := HKEY_LOCAL_MACHINE
if :OpenKey(
" SystemCurrentControlSetServicesLanmanWorkStationParamete rs " ) == 0
if :GetNumeric( "EnableOpLocksForceClose" ) == 1
:CloseKey()
return nil
endif
:SetNumeric( "UseOpportunisticLocking", 0 ) // por defecto no
existe la clave
:SetNumeric( "EnableOpLocks", 0 ) // por defecto no
existe la clave
:SetNumeric( "EnableOpLocksForceClose", 1 ) // por defecto no
existe la clave
:SetNumeric( "UtilizeNtCaching", 0 ) // por defecto no
existe la clave
:SetNumeric( "UseLockReadUnlock", 0 ) // por defecto no
existe la clave
:CloseKey()
endif
if :OpenKey( "SystemCurrentControlSetServicesMRXSmbParameters" )
== 0 // XP
:SetNumeric( "OpLocksDisabled", 1 ) // por defecto no
existe la clave
:CloseKey()
elseif :OpenKey( "SystemCurrentControlSetServicesVxDVREDIR" ) == 0
// Win9x
:SetNumeric( "DiscardCacheOnOpen", 1 ) // por defecto ni idea
:CloseKey()
endif
End With
RETURN nil
--
Regards,
Jose F. Gimenez
http://www.xailer.com