Func _SetComputerName($Hostname);设置计算机名和描述
$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)
Return $Return
EndFunc ;==>_SetComputerName
_SetComputerName("11")
|