Setting registry value

J

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
 
G

Gregory A. Beamer

John said:
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

************************************************
| Think outside the box! |
************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top