Home All Groups Group Topic Archive Search About

Setting registry value

Author
2 Apr 2010 3:35 AM
John
Hi

How can I check for this registry value;

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\MyApp Log]
"Retention"=dword:00000000

and if it does not exist to create it and if it exists make sure the value
of "Retention"key is 00000000?

Many Thanks

Regards

Author
2 Apr 2010 1:40 PM
Gregory A. Beamer
"John" <info@nospam.infovis.co.uk> wrote in message
news:O$F#5Vh0KHA.6108@TK2MSFTNGP06.phx.gbl...
> Hi
>
> How can I check for this registry value;
>
> [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\MyApp Log]
> "Retention"=dword:00000000
>
> and if it does not exist to create it and if it exists make sure the value
> of "Retention"key is 00000000?

Read this for registry info:
http://www.codeproject.com/KB/vb/registry_with_vb.aspx

Note that you have to have the proper permissions on the registry to use
this. Some users might have install privileges, but no ability to access
certain registry keys due to permissions given on the domain they belong to.
You have to keep this in mind for business software.

I am not sure about one thing. Why do you have a key that always has to be a
certain value, or am I missing something? If it is a constant, it does not
have to be in the registry, as it will never change.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
Show quoteHide quote
|    Think outside the box!                        |
************************************************