1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

ip issue

Discussion in 'Windows XP' started by dctechie, Oct 7, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. dctechie

    dctechie Thread Starter

    Joined:
    Oct 7, 2008
    Messages:
    4
    i have a batch file to change my ip settings. so far it looks like it's working........... partially. what it does is change my nic settings from dhcp to static ip and assigns an ip address and subnet mask and default gateway. when i run ipconfig it shows up at static. When I look at the settings in network places, on the properties tab for tcp/ip those check boxes haven't changed. what dos command sets this value and changes the nic from dhcp to static in network places?
     
  2. fairnooks

    fairnooks Banned

    Joined:
    Oct 1, 2007
    Messages:
    5,251
    Where you are looking and they haven't changed (properties for TCP/IP) is where I enter my static IP values and DNS. I then ok it and its changed and permanent until changed. You shouldn't need a batch file just to do that.
     
  3. dctechie

    dctechie Thread Starter

    Joined:
    Oct 7, 2008
    Messages:
    4
    i'm looking in start>settings>network connections>Local Area Connection

    the dhcp box is still check, though when i run ipconfig in dos it shows up at 'static' after i run the script.

    the reason i'm using the batch file is i'm working on automating the process and don't want to sit in front of my pc constantly while this task runs
     
  4. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Welcome to TSG!

    Can you post the portion of the batch file you are using that changes the settings? (remove any private info such as public IP addresses, names, etc)
    If you can post the results of the ipconfig /all command both before and after that would be useful. (To copy the contents of the Command Prompt window, right click the command prompt, chose Select All, press enter, then paste into a reply window)

    The batch in post three of this thread will change the IP to a static one, and when I go to the properties of the Local Area Connection is has been switched to static and shows the static values, so I'm curious as to the method you are using and why it doesn't update the properties window.

    Jerry
     
  5. fairnooks

    fairnooks Banned

    Joined:
    Oct 1, 2007
    Messages:
    5,251
    What is the advantage of setting static IP with a batch file versus setting it manually in the TCP/IP properties? I'm just curious since I don't understand the need for any systems under someones direct control, so there's gotta be something I'm missing.
     
  6. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    It would be faster than manually configuring multiple PCs, less typing anyways, and no chance that you'll mistype something.

    If they are currently on a network you could run the script from a share on a server and assign an IP from a list based on PC name.

    Or put the batch on a flash drive and assign IP's that way, either by having the batch prompt for the last digit, or assign IPs based on PC name, or keep a list of IPs assigned saved on the flash. A separate batch would reset the list.

    As to why, the one thing that comes to mind is if you have frequent LAN parties for gaming, but the router is set to only give out 5 addresses with a 7 day lease time, there are already 4 PCs in the house, and you can't change the router DHCP settings (Dad says "You kids are NOT going to mess with the router!")

    Wouldn't take long to run out of addresses.

    Just a guess though.

    Jerry
     
  7. dctechie

    dctechie Thread Starter

    Joined:
    Oct 7, 2008
    Messages:
    4
    thanks for the welcome. since i'm on a different pc i'm unable to give you the output from the ipconfig /all command, however I can show the script below:

    ipconfig /release

    netsh interface ip set address name = "Local Area Network Connection" source = static addr = 192.168.0.X mask = 255.255.255.0 gateway = 192.168.0.X gwmetric = 1

    netsh interface ip set address name="Local Area Network Connection" source=dhcp


    thanks for your help
     
  8. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Tried that on 3 test systems (WinXP Pro SP1, XP Pro SP2, and Win2K SP4), and when I go to the TCP/IP properties windows the static settings are being displayed.

    Only difference is my connection is named just Local Area Connection. Shouldn't make a difference, but I renamed one to Local Area Network Connection just to test but it made no difference. The TCP/IP Properties shows the setting that is set using the netsh command as soon as it completes.

    I don't know why that isn't being displayed on your system. Unless you have 2 local area connections that have nearly identical names, and are not looking at the same one you are setting. In that case both connections should appear in the ipconfig output and in the network connections folder.

    You did use different names in these two posts though, but I'd think that was just that you typed them differently.

    You could try netsh interface show interface to see if maybe there are any connections (other than Internal and Loopback) that don't appear in the Network Connections folder.

    Have you tried this on more than one PC? If it's just one PC that does this the TCP/IP stack may be corrupted. You can reset it with these two commands:

    Reset TCP/IP stack to installation defaults. netsh int ip reset c:\reset.log

    Reset WINSOCK entries to installation defaults: netsh winsock reset

    Can't think of anything else at the moment.

    Jerry

    PS, if these systems will need internet access, you'll need to set a DNS address using netsh interface ip set DNS name = "Local Area Network Connection" source = static addr = DNS Server Address
     
  9. dctechie

    dctechie Thread Starter

    Joined:
    Oct 7, 2008
    Messages:
    4
    i'll take a closer look at that. i noticed that when i run the batch file, then run ipconfig, the ip address is different and it's static, yet in the tcp/ip properties window it's still set to dhcp and even stranger is the fact that the network icon in the lower right hand corner of the screen says "Warning Limited Connectivity" after i go into the properties box and set it to dhcp it goes out and gets a new ip address and works fine. but something about that script "limits" the connectivity after that. i'll try it again tonight and paste the output in this forum.
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - issue
  1. Mzinman
    Replies:
    8
    Views:
    252
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757015

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice