cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dushkin
Level 3

Setting hostname as registry key name

Hello,

Can someone help me please to accomplish the task in title?

I need to set the key name on run time as the target host name.

Many thanks!
Labels (1)
0 Kudos
(2) Replies
Christopher_Pai
Level 16

Just use [ComputerName] for the key name.
0 Kudos
retzcat
Level 6

This worked for me to get the information.... You could try to use the RegDBSetKeyValueEx instead

string nvtype,svValue;
number nvSize,nvType;
begin

RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx ( "SYSTEM\\ControlSet001\\Services\\Eventlog" , "ComputerName" , nvType , svValue , nvSize );
switch (nvType)
case REGDB_STRING:
MessageBox("REGDB_STRING",INFORMATION);
case REGDB_STRING_EXPAND:
MessageBox("REGDB_STRING_EXPAND",INFORMATION);
case REGDB_STRING_MULTI:
MessageBox("REGDB_STRING_MULTI",INFORMATION);
case REGDB_NUMBER:
MessageBox("REGDB_NUMBER",INFORMATION);
case REGDB_BINARY:
MessageBox("REGDB_BINARY",INFORMATION);
default:
MessageBox("Other",INFORMATION);
endswitch;

SprintfBox (INFORMATION, "", "RegDBGetItem retrieved the value " +
"of the application path key: %s.", svValue);
0 Kudos