.:++ Me+MySelf & I ++:.

dari dalam diri seorang aku..

Skrip Tukar IP April 23, 2007

Filed under: Windows — asriey @ 4:59 pm

Skrip ni adalah untuk windows.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strIPAddress = Array("192.168.1.2")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.1.1")
strGatewayMetric = Array(1)
' --------- END CONFIGURATION ------

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set adapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each a in adapters
errIP = a.EnableStatic(strIPAddress, strSubnetMask)
errGateways = a.SetGateways(strGateway, strGatewaymetric)
If errIP = 0 Then
WScript.Echo "Success! The IP address has been changed."
Else
WScript.Echo "Error! The IP address could not be changed."
End If
Next

untuk menggunakan skrip ni, copy semua yang kat atas tu, paste kat dalam notepad, pastu ubah ikut configurasi yang diperlukan, save as .vbs. untuk guna, just klik 2x.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s