用户名:
   密  码:
             
 用户注册!    忘记密码?
 
 
 
手机号码:15850899989
联系电话:0523-82629588
 
联系QQ:24小时维护QQ 隐身中……
  QQ维护群:60586583
 当前位置:首页 - 新闻中心 - 常见问题
 
  一键改机器名、IP、子网掩码、DNS  
     
发布时间:2010.08.18 新闻来源:靖江星雨电脑维护有限公司 浏览次数:
 

Dim Num
Num=Inputbox ("   一键改机器名、IP、子网掩码、DNS"+chr(10)&chr(13)+"      ≡星雨电脑 QQ:4614851≡"+chr(10)&chr(13)+"        联系电话:15850899989"+chr(10)&chr(13)+"请输入机器编号【填小于255以下的整数】")
dim Name
if Num<10 then
   Name="hotel800"
else
   if Num<100 then
         Name="hotel80"
   else
             Name="hotel8"
       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 objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("192.168.1."&Num)
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.1.1")
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway)
Dim dns
dns=Array("221.228.255.1","218.2.135.1")
err=objNetAdapter.SetDNSServerSearchOrder(dns)
Next

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputers = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
'ObjComputer.Rename("game" &Num)
Next
Set objNetworkSettings = objWMIService.Get("Win32_NetworkAdapterConfiguration")
objNetworkSettings.SetIPXVirtualNetworkNumber(Num)

 
地址:江苏省靖江市中洲西路28号  电话:0523-82629588   24小时服务热线:15850899989
邮编:214500 E-mail:admin@it0523.com  苏ICP备17010739号