打印

[求助] 那位高人有改客户端IP地址的脚本

那位高人有改客户端IP地址的脚本

那位高人有改客户端IP地址的脚本

TOP

可以参考http://www.newsunday.com/post/338.html g q0 Z9 y$ O0 Z4 i7 [
% ?& l7 T: m- b9 s. K8 x: a
云烟缈缈几层间,万水千山显世间,梅兰竹菊朦胧伴,英才陪书与昼夜。
欢迎骚扰:kenknigh@hotmail.com                

TOP

复制内容到剪贴板
代码:
if Wscript.arguments.count<3 then
wscript.echo " ProGram:xiaohua QQ:56111981"
wscript.echo " Please Input like:"&vbcrlf&" cscript setip.vbs ipaddress subnetmask gateway"
wscript.echo " cscript setip.vbs 192.168.0.39 255.255.255.0 192.168.0.1"
wscript.quit
end if
setIp=Wscript.Arguments(0)
SubnetMask=Wscript.Arguments(1)
GateWay=Wscript.Arguments(2)

'机器名,.代表本机
strComputer="."
Set objWMIService = GetObject("winmgmts:\\"&strComputer&"\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress=Array(setIp)
strSubnetMask=Array(SubnetMask)
strGateway=Array(GateWay)
strGatewayMetric=Array(1)
For Each objNetAdapter in colNetAdapters
errEnable=objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways=objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable=0 Then
WScript.Echo "The IP address has been changed."
Else
WScript.Echo "The IP address could not be changed."
End If
Next
cscript下用参数启动……
; h% J. s( p$ t! j* D
! {2 n! p: `3 r) S不过这是针对本机的,如果用AD推的话不一定有效果……; \2 h) i* \6 y0 h1 p7 l. A- u# R' k
0 \6 ^" E I4 P# T$ i4 o; j
[ 本帖最后由 ghjconan 于 2007-5-5 19:44 编辑 ]
本帖最近评分记录
  • mwpq 菊花元 +10 well down thanks. 2007-5-8 06:07

TOP