Use InstallShield to get a registry key value script _ other

Source: Internet
Author: User
Use
Nvtype = Regdb_number;
Szkey = "\\SYSTEM\\CurrentControlSet\\Servic
Es\\{58ecc408-265e-4342-9da4-70bf1796d81d}\\parameters\\tcpip ";
SzName = "EnableDHCP"
Regdbsetdefaultroot (HKEY_LOCAL_MACHINE);
Regdbgetkeyvalueex (Szkey, SzName, Nvtype, Svvalue, nvsize);
if (Svvalue = "1") Then
SzName = "DhcpIPAddress";
Else
SzName = "IPAddress";
endif
Nvtype = regdb_string;
Regdbsetdefaultroot (HKEY_LOCAL_MACHINE);
Regdbgetkeyvalueex (Szkey, SzName, Nvtype, Svvalue, nvsize); <p> the above program is actually how to obtain the key value in the registry, if used to obtain IP, the above {58ecc408-265e-4342-9da4-70bf1796d81d} is on my machine, your GUID may not be the same as mine, But you can also get from the following registry:
Hkey_local_machine\system\currentcontrolset\services\tcpip\parameters\adapters
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
Hkey_local_machine\system\currentcontrolset\services\el90x1\parameters\tcpip (if present)


Similarly, if you want to get your hostname, you can use the following procedure:
Regdbsetdefaultroot (HKEY_LOCAL_MACHINE);
Regdbgetkeyvalueex ("System\\currentcontrolset\\control\\computername\\computername", "ComputerName", NvType, Szserverport, nvsize);

You can get other key values from the registry by using the example above.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.