Thread: Macro help
View Single Post
Old July 3rd, 2009, 08:23 AM   #9 (permalink)
wormboy
Post Whore
 
wormboy's Avatar
 
Join Date: Nov 2008
Posts: 412
My dad had once tried to block my internet access when I was younger, but I fucking owned him using a similar technique.

I wasn't familiar with how these popular file hosting services operate. So, I did the research. Now I see where the user IP comes into the picture. This will change the IP:

usage:
cmd.exe cscript changemyip.vbs <computer name> <ip address>

examples:
cmd.exe cscript changemyip.vbs . 192.168.1.104
cmd.exe cscript changemyip.vbs wormboy 192.168.1.104
cmd.exe cscript changemyip.vbs "daves computer" 192.168.1.104

note:
in the first example, a period(.) is used as the computer name, which means root, or local computer

Code:
Dim subnetMask, matchValue, sql, arguments(2)

If Wscript.Arguments.Count <> 2 Then
Wscript.Quit
End If

arguments(0) = Wscript.Arguments.Item(0)
arguments(1) = Array(Wscript.Arguments.Item(1))

matchValue = "IPEnabled = TRUE"
subnetMask = Array("255.255.255.0")
sql = "Select * from Win32_NetworkAdapterConfiguration Where " & matchValue

Set objWMIService = GetObject("winmgmts:\\" & arguments(0) & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery(sql)

For Each objNetAdapter In colNetAdapters
objNetAdapter.EnableStatic(arguments(1), subnetMask)
Next
I highlighted the stuff you might want to change.

To change the IP of all network adapters that have TCP/IP bound and enabled, use:
matchValue = "IPEnabled = TRUE"

Or you might want to change the IP of a particular adapter, in which case you'd use:
matchValue = "Description = 'Wireless-G Notebook Adapter'"

Shoot back if you need any more info. Good luck.
__________________
"Blow it out your ass U pathetic piece of shit." -- blah2
wormboy is offline   Reply With Quote