谁能帮我写一个自动填写ip的程序

来源:百度知道 编辑:UC知道 时间:2024/05/06 15:05:20
写好后送100分
ip 192.168.9.8
网关 192.168.9.1
首选dns服务器 202.102.224.68

VBS脚本如下
Dim Num
Num=Inputbox ("自动填写ip的程序"+chr(10)&chr(13)+"必须是小于200以下的数字"+chr(10)&chr(13)+"请输入机器号")
dim Name
if Num<10 then
Name="XD00"
else
if Num<100 then
Name="XD0"
else
Name="XD"
end if
end if

Set Sh = CreateObject("WScript.Shell")
Sh.RegWrite "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName",Name&Num,"REG_SZ"
Sh.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname",Name&Num,"REG_SZ"
Sh.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname",Name&Num,"REG_SZ"
Set sh = Nothing
Set oShell = Nothing
strComputer = "."
Set objWMIServ