Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry - updating a string value

Status
Not open for further replies.

pd123

Programmer
May 22, 2001
48
GB
Hi,

I am having problems updating a value in the registry. I can open the subkey up, and read values no problem, but when I try a HKwf.SetValue("LastRun", "Yes") I get the following error message:

Cannot write to the registry key.

It doesn't seem to suggest a permissions problem, but does it need setting? The code is a vb.net exe, and is been started from the Administrator account.

Any suggestions welcomed.

Thanks,
pd123

 
Sorted it - forgot to set the "writable" boolean when calling OpenSubKey.

Doh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top