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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reg editing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I can't seem to find a simple way to edit the registry from an executable file. I need to find (and understand) a simple console application script to edit the registry. Maybe an executable with a reg file in the resource file and the executable executes the reg file from the resource file.
 
For Editing the registry you need to use the simple class CRegKey.

for example

CRegKey reg;
CString str;

UpdateData();

str.Format("%d", m_nDate);
reg.Open(HKEY_CURRENT_USER, "SYSTEM");
reg.Create(reg.m_hKey, m_sName);
reg.SetValue(str, "Date");
reg.SetValue(m_sName, "Name");

reg.Close();
 
Would this work?

CRegKey reg;
CString str;

UpdateData();

str.Format("%d", m_nDate);
reg.Open(HKEY_CURRENT_USER, "Software\\Logitech\\MouseWare\\CurrentVersion\\Control Center\\Schemes\\.Default\\Devices\\Cordless6\\0001\\Assignments\\MiddleMouseShortClick\\AutoScroll\\");
reg.SetValue(str, "2");
reg.SetValue(m_sName, "ScrollCompatibility");

reg.Close();

The name of the property is ScrollCompatibility and I want the data to change to "2".
 
Would this work?

CRegKey reg;
CString str;

UpdateData();

str.Format("%d", m_nDate);
reg.Open(HKEY_CURRENT_USER, "Software\\Logitech\\MouseWare\\CurrentVersion\\Control Center\\Schemes\\.Default\\Devices\\Cordless6\\0001\\Assignments\\MiddleMouseShortClick\\AutoScroll\\");
reg.SetValue(str, "2");
reg.SetValue(m_sName, "ScrollCompatibility");

reg.Close();

The name of the property is ScrollCompatibility and I want the data to change to "2".
 
All I need to do is edit the registry. Please tell me the problems/errors with my script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top