Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Системное программирование и WinAPI > Работа с реестром по сети


Автор: oper54 13.4.2006, 11:19
Доброе время суток...
Нужно изменить параметр реестра на другой машине в сети.
Права администратора домена у меня есть.
Подскажите пожалуйста, где можно почитать
про изменение параметров реестра в сети.
Или приведи прмер.

Автор: adonin 13.4.2006, 11:36
Смотри функцию RegConnectRegistry(). MSDN:
Цитата

LONG RegConnectRegistry(
  LPTSTR lpMachineName,
                    // address of name of remote computer
  HKEY hKey,        // predefined registry handle
  PHKEY phkResult  // address of buffer for remote registry handle
);

Parameters
lpMachineName
Pointer to a null-terminated string containing the name of the remote computer. The string has the following form:
\\computername

If lpMachineName is NULL, the local computer name is used.

hKey
Specifies the one of the following predefined registry handles on the remote computer.
HKEY_LOCAL_MACHINE
HKEY_USERS
Windows NT: HKEY_PERFORMANCE_DATA, if the remote computer is running Windows NT
Windows 95 and Windows 98: HKEY_DYN_DATA, if the remote computer is running Windows 95 or Windows 98
Windows 95 and Windows 98: HKEY_CURRENT_CONFIG, if the remote computer is running Windows 95 or Windows 98

You cannot specify the HKEY_CLASSES_ROOT or HKEY_CURRENT_USER value for this parameter.

phkResult
Pointer to a variable that receives a key handle identifying the predefined handle on the remote computer.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

Remarks
When a handle returned by RegConnectRegistry is no longer needed, it should be closed by calling RegCloseKey.


см. также RegCreateKeyEx(), RegCloseKey(), RegSetValueEx(), RegEnumKeyEx(), RegEnumValue()...

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)