陌上风 发表于 2008-6-15 17:25:39

如何用 AU3 改计算机名?



例如,把 wind 改为 pc123

[ 本帖最后由 陌上风 于 2008-6-17 17:52 编辑 ]

木纳 发表于 2008-6-15 18:14:17

改注册表的.
然后刷新一下.

cxlater 发表于 2008-6-15 18:20:09

注册表或wmi都可以

vv3509 发表于 2008-6-15 23:17:15

Func _SetComputerName($Hostname, $Hostname1);设置计算机名和描述
        $SetKey1 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\"
        $CtrlKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\"
        $Return = RegWrite($SetKey1 & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $Hostname)
        RegWrite($SetKey1 & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $Hostname)
        RegWrite($SetKey1 & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $Hostname)
        RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters', "srvcomment", "REG_SZ", $Hostname1)
        $str1 = StringRegExp($Hostname, ".*(.{3})", 1)
        RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters", "VirtualNetworkNumber", "REG_DWORD", "0x" & $str1)
        Return $Return
EndFunc   ;==>_SetComputerName

gordonbwb 发表于 2009-10-15 00:54:46

好像这个简单点
http://www.autoitx.com/forum.php?mod=viewthread&tid=14&highlight=%BC%C6%CB%E3%BB%FA%C3%FB

au3x 发表于 2011-11-23 14:43:04

学习一下。。。

llwan_love 发表于 2012-1-5 13:35:19

要是有办法不重启就能成功改电脑名称并生效就完美了!

502762378 发表于 2012-1-7 17:13:31

域环境不可能

ferelove 发表于 2012-1-26 22:35:23

本帖最后由 ferelove 于 2012-1-26 22:37 编辑

要是有办法不重启就能成功改电脑名称并生效就完美了!

抄用一段DOS命令,转成AU3应该不难。不重启电脑生效。set "PCName=AU3TEST"
rem 更改机器名
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /d "%PCName%" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "Hostname" /d "%PCName%" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v "ComputerName" /d "%PCName%" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v "ComputerName" /d "%PCName%" /f
taskkill /f /im explorer.exe & explorer.exe
页: [1]
查看完整版本: 如何用 AU3 改计算机名?