[Help] Modifications in a batch file

RodrigoTrevizan

New member
Local time
1:57 AM
Messages
6
Location
Manaus, Amazonas
ipconfig /release
netsh interface ip set address offboard static 111.111.111.111 255.0.0.0
netsh interface ip set address offboard dhcp
ipconfig /renew
Anyone could help me to make this a working file at Windows Seven?
I used it on XP to change my IP until now, but when I try to run now it doesn't work
Obs: Offboard is the name of the connection
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
Try this:

Code:
ipconfig /release
netsh interface ip set address "Offboard" static 111.111.111.111 255.0.0.0
netsh interface ip set address "Offboard" dhcp
ipconfig /renew

Of course it might work without the quotation marks, but if the name is Offboard then you'll need it capitalized correctly for it to work, IIRC.

Also, the help info in the command shows some other options as well that you might want ot take a look at - in *particular* if the OS is still *internally* recognizing the connection as "Local Area Connection":

Code:
C:\>netsh interface ip set address -?

Usage: set address [name=]<string>
             [[source=]dhcp|static]
             [[address=]<IPv4 address>[/<integer>] [[mask=]<IPv4 mask>]
             [[gateway=]<IPv4 address>|none [gwmetric=]<integer>]
             [[type=]unicast|anycast]
             [[subinterface=]<string>]
             [[store=]active|persistent]

Parameters:

       Tag            Value
       name         - Interface name or index.
       source       - One of the following values:
                      dhcp: Enables DHCP for configuring IP addresses for
                            the specified interface.
                      static: Disables DHCP for configuring IP addresses for
                            the specified interface. This value must be
                            specified if an address or a gateway is being
                            configured.
       address      - IPv4 address to add or modify, optionally followed by
                      the subnet prefix length.
       mask         - The IP subnet mask for the specified IP address.
       gateway      - One of the following values:
                      <IPv4 address>: A specific default gateway for the
                                      static IP address you are setting.
                      none: No default gateways are set.  This is the default.
       gwmetric     - The metric for the default gateway. This field should
                      be set only if gateway is specified.
       type         - One of the following values:
                      unicast: Marks the address as a unicast address.
                               This is the default.
                      anycast: Marks the address as an anycast address.
       subinterface - LUID of the subinterface on which the default gateway
                      exists.  This parameter is only needed on interfaces
                      with multiple subinterfaces.
       store        - One of the following values:
                      active: Set only lasts until next boot.
                      persistent: Set is persistent.  This is the default.

Remarks: Used to enable or disable DHCP for IP address configuration.
         Also removes any previous static IP addresses and default gateways,
         and can add a new static IP address and default gateway.

Examples:

       set address name="Local Area Connection" source=dhcp
       set address "Local Area connection" static 10.0.0.9 255.0.0.0 10.0.0.1 1
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    The Beast Model A (homebrew)
    OS
    Windows 11 21H2 Current build
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * 32 GB - Corsair Vengeance 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2x Eve Spectrum ES07D03 4K Gaming Monitor (Matte) | Eve Spec
    Screen Resolution
    3x 3840 x 2160
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM) } 3x Sabrent Rocket NVMe 4.0 1 TB SSD
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Plat
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    SteelSeries Apex Pro Wired Gaming Keyboard
    Keyboard
    SteelSeries Apex Pro
    Mouse
    Logitech MX Master 3S | MX Master 3 for business
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
    Antivirus
    Windows Defender + MB 3
    Browser
    Nightly (default) + Firefox (stable),Chrome, Edge
  • Computer type
    PC/Desktop
    System Manufacturer/Model Number
    Dell Latitude E5470
    OS
    ChromeOS Flex Dev Channel (current)
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics Card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryville 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Keyboard
    Dell
    Mouse
    Logitech MX Master 3S (shared w. Sys 1) | Dell TouchPad
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
Still doesn't work, the lines:
netsh interface ip set address "Offboard" static 111.111.111.111 255.0.0.0
netsh interface ip set address "Offboard" dhcp
I don't get any response even in cmd

I think it might have something to do with IPv6/Ipv4
At XP, the adapter only have IPv4 I think
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
Correct.

When I did the commands to figure out the help, ip as an option is not actually listed - only ipv4 and ipv6 are listed, leading me to think that substituting ipv4 for ip should do the trick.

however, when I manually typed in ip as an option it brought up the help info for it, almost as if it is a hidden option....

Unless, of course, 7 is defaulting ip to refer to ip6....which could be *another* reason you're not getting a response at all....
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    The Beast Model A (homebrew)
    OS
    Windows 11 21H2 Current build
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * 32 GB - Corsair Vengeance 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2x Eve Spectrum ES07D03 4K Gaming Monitor (Matte) | Eve Spec
    Screen Resolution
    3x 3840 x 2160
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM) } 3x Sabrent Rocket NVMe 4.0 1 TB SSD
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Plat
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    SteelSeries Apex Pro Wired Gaming Keyboard
    Keyboard
    SteelSeries Apex Pro
    Mouse
    Logitech MX Master 3S | MX Master 3 for business
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
    Antivirus
    Windows Defender + MB 3
    Browser
    Nightly (default) + Firefox (stable),Chrome, Edge
  • Computer type
    PC/Desktop
    System Manufacturer/Model Number
    Dell Latitude E5470
    OS
    ChromeOS Flex Dev Channel (current)
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics Card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryville 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Keyboard
    Dell
    Mouse
    Logitech MX Master 3S (shared w. Sys 1) | Dell TouchPad
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
yes you should be using instead of ip ipv4...
like this...
Code:
netsh int ipv4 set addr "Offboard" static 111.111.111.111 255.0.0.0
netsh int ipv4 set addr"Offboard" dhcp
 

My Computer

Computer Manufacturer/Model Number
Tx2500z Tablet Pc/Homemade Server
OS
Windows 7 Ult x64(x2), HomePrem x32(x4), Server 08 (+VM), 08 R2 (VM) , SuSe 11.2 (VM), XP 32 (VM)
CPU
Turion X2 ultra (oh well came with laptop)/P4 @3.2 (yes P4)
Motherboard
IDK HP Motherboard / Intel DG965SS
Memory
OCZ Dual Channel 4GB kit/ 1gb Dual Channel
Graphics Card(s)
HD 3200 graphics /GMA x3100 (yay for intergrated!!)
Sound Card
Realtek HD Audio(mic working, well sort of)/Siig IC-70012
Monitor(s) Displays
built-in Hp 12" laptop screen/ Acer 19"
Screen Resolution
1280x800 /1440x900
Cooling
All Air Cooled
Mouse
Logi MX Rev. /MS Wheel Optical 1.1A /Logitech Optical Mouse
Internet Speed
College baby but its still routed through vpn to 1536k...
Other Info
love my wacom pen and pressure sensitivity...
wished it worked in 7, SUSE for that matter though
OK
Now I can do the primary objective (change the ip to a static one then dhcp it)
But can't trick the internet company anymore T_T
When I set dhcp, it comes back to the same IP
But with XP I always got a "new" one
I'll try to find another way to change my IP,
Thanks anyway :D
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
Hello,
I'm here again, just need to know something, how do I deactivate the "preferred" IP thing?
I don't want for windows to log the last ip, so when I do the ipconfig/release-renew thing it gets another IP by DHCP
I know that in my internet provider I can do such thing (I did that a lot on XP)

IPv4 Address. . . . . . . . . . . : 192.168.0.10(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
you are using a router yes?
if you are then the this is a IP for your network (any computers that you own and are connected to your router are part of this network)
otherwise (if you dont have a router) then your this IP is being routed internally (the ISP/building is using NAT routers) and this is not a "outside" Internet IP...
this usually happens when you have a small ISP or a ISP that is running out of external ip address and now to conserve its share may now be routing them...
 

My Computer

Computer Manufacturer/Model Number
Tx2500z Tablet Pc/Homemade Server
OS
Windows 7 Ult x64(x2), HomePrem x32(x4), Server 08 (+VM), 08 R2 (VM) , SuSe 11.2 (VM), XP 32 (VM)
CPU
Turion X2 ultra (oh well came with laptop)/P4 @3.2 (yes P4)
Motherboard
IDK HP Motherboard / Intel DG965SS
Memory
OCZ Dual Channel 4GB kit/ 1gb Dual Channel
Graphics Card(s)
HD 3200 graphics /GMA x3100 (yay for intergrated!!)
Sound Card
Realtek HD Audio(mic working, well sort of)/Siig IC-70012
Monitor(s) Displays
built-in Hp 12" laptop screen/ Acer 19"
Screen Resolution
1280x800 /1440x900
Cooling
All Air Cooled
Mouse
Logi MX Rev. /MS Wheel Optical 1.1A /Logitech Optical Mouse
Internet Speed
College baby but its still routed through vpn to 1536k...
Other Info
love my wacom pen and pressure sensitivity...
wished it worked in 7, SUSE for that matter though
If I change the mac of my network board the IP will change, but its too complicated...

I'm not using any router, the computer is the same way I used to do when it was XP, it's something in seven's configuration,
When I was in dual-boot with XP i could change the IP only doing that thing I posted in the beginning of the topic, but I formated the XP partition and now I'm lost...

I need something to make Seven forget the old IP and get any other avaliable in the provider instead of the same...

This is my real IP, the other was just an example:
IPv4 Address. . . . . . . . . . . : 201.75.107.73(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.248.0

Sorry if I can't express myself clearer, English is not my first language :P
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
UP...
 

My Computer

OS
Windows Seven
CPU
Athlon 64 x2 5200+
Motherboard
AMD690GM-M2
Memory
2x 2GB 800Mhz Corsair
Graphics Card(s)
ATI Sapphire HD 2600xt GDDR4
Screen Resolution
1024*768
Hard Drives
Maxtor 250GB
Internet Speed
500K
Try releasing the IP and then rebooting to see if it grabs a new IP on the reboot....
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    The Beast Model A (homebrew)
    OS
    Windows 11 21H2 Current build
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * 32 GB - Corsair Vengeance 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2x Eve Spectrum ES07D03 4K Gaming Monitor (Matte) | Eve Spec
    Screen Resolution
    3x 3840 x 2160
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM) } 3x Sabrent Rocket NVMe 4.0 1 TB SSD
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Plat
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    SteelSeries Apex Pro Wired Gaming Keyboard
    Keyboard
    SteelSeries Apex Pro
    Mouse
    Logitech MX Master 3S | MX Master 3 for business
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
    Antivirus
    Windows Defender + MB 3
    Browser
    Nightly (default) + Firefox (stable),Chrome, Edge
  • Computer type
    PC/Desktop
    System Manufacturer/Model Number
    Dell Latitude E5470
    OS
    ChromeOS Flex Dev Channel (current)
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics Card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryville 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Keyboard
    Dell
    Mouse
    Logitech MX Master 3S (shared w. Sys 1) | Dell TouchPad
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
I've been using this on XP, then when I upgrade my pc I can't do it on Windows 7, Honestly I've been trying with IpV4 and commands around both Ip configs that (7) gots but unfortunatelly can't run the batch file to change the IP on my PC with (7). Could anyone help me please?

netsh interface ip set address name="LAN" source=static addr=10.160.5.181 mask=255.255.0.0 gateway=10.160.1.1 gwmetric1
netsh interface ip set dns name="LAN" source=static addr=10.10.1.46
netsh interface ip add dns name="LAN" addr=10.10.1.52
 

My Computer

OS
Windows 7
Please, could anyone help to me_

I've trying many ways to get change the ip in windows vista but can't, I'm doing some sily mistake. This is how I do in XP
netsh interface ip set address name="LAN" source=static addr=10.160.5.181 mask=255.255.0.0 gateway=10.160.1.1 gwmetric1
netsh interface ip set dns name="LAN" source=static addr=10.10.1.46
netsh interface ip add dns name="LAN" addr=10.10.1.52


I beg to anyone support me on this stuff to get work into windows 7

Thanks a lot

Renee
 

My Computer

OS
Windows 7
Batch file

I've trying many ways to get change the ip in windows vista but can't, I'm doing some sily mistake:cry:.
This is how I do in XP
netsh interface ip set address name="LAN" source=static addr=10.160.5.181 mask=255.255.0.0 gateway=10.160.1.1 gwmetric1
netsh interface ip set dns name="LAN" source=static addr=10.10.1.46
netsh interface ip add dns name="LAN" addr=10.10.1.52


I beg to anyone support me on this stuff to get work into windows 7

Thanks a lot

Renee
 

My Computer

OS
Windows 7
Back
Top