Setting registry value

  • Thread starter Thread starter John
  • Start date Start date
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
 
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! |
************************************************
 
Back
Top