accessing registry

how can I acces the registry by a ms-dos program, when windows is not loaded (but ms-dos is)?
smaugwarAsked:
Who is Participating?
 
nv3prasadConnect With a Mentor Commented:
In VC6.0 create an Console Appliation with MFC support and use

In your WinApp InitInstance use,

free((void*)m_pszRegistryKey);
//Change the name of the registry key.

SetRegistryKey(_T("Your Key"));

Add the Following code to write to the registry location,

AfxGetApp()->WriteProfileString("Complete Path of the Reg Key",
 "Reg key" Item", "Value of Item");


Add the Following code to Read from registry location,

AfxGetApp()->GetProfileString(
"Complete Path of the Reg Key",
 "Reg key" Item", "Value of Item");


0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

U want to get registry from Dos promt?
Then just type regedit at C:\Windows, u will get the details. then give the option and u will get the details. The option will be as

Imports and exports registry files to and from the registry.

REGEDIT [/L:system] [/R:user] filename1
REGEDIT [/L:system] [/R:user] /C filename2
REGEDIT [/L:system] [/R:user] /E filename3 [regpath1]
REGEDIT [/L:system] [/R:user] /D regpath2

  /L:system       Specifies the location of the SYSTEM.DAT file.
  /R:user         Specifies the location of the USER.DAT file.
  filename1       Specifies the file(s) to import into the registry.
  /C filename2    Specifies the file to create the registry from.
  /E filename3    Specifies the file to export the registry to.
  regpath1        Specifies the starting registry key to export from.
                  (Defaults to exporting the entire registry).
  /D regpath2     Specifies the registry key to delete.

Try it out.
VinExpert
0
All Courses

From novice to tech pro — start learning today.