1.

Solve : How 2 change Ip and MAC addresses ??

Answer»

8-)

Using [Version 4.10.2222]Using [Version 4.10.2222] of what? :-?

I suggest you use Google for spoofing your MAC address. I found a truckload of responses.

This little SCRIPT will change the IP and subnet:

Code: [Select]strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")

strIPAddress = Array("192.168.1.0") 'Change as necessary
strSubnetMask = Array("255.255.255.0") 'Change as necessary

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next

After you save the script with a vbs extension, run from the command line: cscript scriptname.vbs

8-)Thanks
in the ip address change script that´s the
output :
scriptname.vbs(2, 1) Error of time of execution of Micrsoft VBScript : Name of file or class not found during operation of automation: 'GetObject
'

ps.:[ The Ver is the DOS Ver ]I'm confused. Are you running DOS 4 or are you running Windows and if so what version. VBScripts need Windows to run. The VBScript posted runs fine in XP.

I'm not aware of any DOS 4 command to change your IP address. You could check out writing a debug script.

Good luck. 8-)Version 4.10.2222 would most probably be win98SE.

For win2000/XP, can also try command line version of SMAC, here
http://www.klcconsulting.net/smac-cl/yeah it´s on win98SEJust an other question how would you change the default gateway with the same script ?
I tried the following but I don't think its working.

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")

strIPAddress = Array("192.168.1.10") 'Change as necessary
strSubnetMask = Array("255.255.255.0") 'Change as necessary
strdefaultgateway = Array("194.168.1.1") 'Change as necessary

For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next



Thanks AlmnCode: [Select]strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strdefaultgateway , strGatewaymetric)
Next


Where do I specify the new gateway adress ?


AlmnQuote

Where do I specify the new gateway adress ?


Almn



Code: [Select]strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")

strIPAddress = Array("192.168.1.10") 'Change as necessary
strSubnetMask = Array("255.255.255.0") 'Change as necessary
strdefaultgateway = Array("194.168.1.1") 'Change as necessary

strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strdefaultgateway , strGatewaymetric)
Next



Would it look different on windows xp? Well i guess so. What i would like to KNOW, plz can someone paste the code for windows xp?

Dont know if this topic closed already. Thank you in advance to whoever posts the code. Thanx.its the same one :-?

Almnyou can specify your new gateway here...
Code: [Select]strdefaultgateway = Array("194.168.1.1") ##change as you wish

Quote
Would it look different on windows xp? Well i guess so. What i would like to know, plz can someone paste the code for windows xp?

Dont know if this topic closed already. Thank you in advance to whoever posts the code. Thanx.

what you can do is a simple TEST. Just copy the code and run it.. If it works on your machine, it means it can also be used for WinXP.
For Windows 2000 / Windows XP, this can probably be done easier with a single line in a batch file, or a single command (change as necessary in order of IP address, subnet mask, defualt gateway, interface metric):
Code: [Select]netsh interface ip set address "Local AREA Connection" static 192.168.1.10 255.255.255.0 192.168.1.1 1


Discussion

No Comment Found