Windows 10: Set manual ip address from user input

Discus and support Set manual ip address from user input in Windows 10 Network and Sharing to solve the problem; Hi all, Can someone point out where I've gone wrong with this batch file. I know it has to be run as an administrator to function correctly.... Discussion in 'Windows 10 Network and Sharing' started by fantom105, Jan 30, 2017.

  1. fantom105 Win User

    Set manual ip address from user input


    Hi all,

    Can someone point out where I've gone wrong with this batch file.

    I know it has to be run as an administrator to function correctly.

    netsh interface ip set address name="Ethernet" source=dhcp
    set /p userInputIP= Enter the 4 DIGIT Number [inc decimal point] (example 90.21) ?
    netsh interface ip set address name= ”Ethernet” static 1.%userinputip%.1 255.255.255.0 1.%userinputip%.254
    netsh interface ip set dns “Local Area Connection” static 1.100.200.1 1.200.300.1
    reg add HKLM\System\CurrentControlSet\Services\Tcpip\Parameters /v "SearchList" /d "servername.net" /f


    The basis here is that a 4 digit number is entered by the user eg: 90.21 which goes into the variable 'userinputip', then this is transferred into the ip address so it becomes 1.90.21.1

    The funny thing is that if I set the static ip in the program it will work.

    If I pause the program after it attempt to input the new ip adress, it does look as if it has worked, yet when I check it with ipconfig it shows that it hasn't, returning the dhcp address.


    Perhaps what I want isn't possible, if that's the case then I have a few ideas:

    The pc name will have numbers in it, like 9021 which can be resolved into a text file from dos using the command echo %computername% > c:\name.txt

    This would return pc9021 providing the pc is named pc9021 into a text file, but how would I import the 9021 and make it 1.90.21.1 ??

    Hope this makes sense, and thanks in advance for any help.

    :)
     
    fantom105, Jan 30, 2017
    #1
  2. amblors Win User

    E72 Duped!

    having a yemeni made product would not affect your connectivity.

    in ur connection settings, just make sure your ip adress is set to automatic rather than manual, if that doesnt work you may want to get an appropriate IP address to input manually.

    cheers
     
    amblors, Jan 30, 2017
    #2
  3. NO GATEWAY REPLY??????????whats that??

    This problem is apparently caused by a DNS error, the URL entered can't be resolved

    The cell access point set up in the cell needs to have a dns server set up.

    A work around is to manually input the DNS server IP address in to the IP4 settings found in the advanced AP set up. Check the DNS server address supplied by your ISP to your modem - it's normally shown in the status display on the router - and manually use
    this address.

    Not an ideal solution - one would prefer for the DHCP to supply the DNS IP - but it should solve the problem until the ISP changes the DNS IP.

    I hope this helps.
     
    rberns---01, Jan 30, 2017
    #3
  4. Samuria Win User

    Set manual ip address from user input

    What is the point of this how will user know what to enter for subnet,IP etc?
     
    Samuria, Jan 30, 2017
    #4
  5. fantom105 Win User
    Subnet is hard coded in the program : 255.255.255.0

    Gateway and dns are also hard coded in.

    All the user needs to do is enter a 4 digit number with a decimal point between the 2nd and 3rd numbers, the rest is taken care of by the program based on the numbers they enter
     
    fantom105, Jan 30, 2017
    #5
  6. Have you searched parsing a variable in a batch command, thinking you may be able to parse computer name.
     
    Caledon Ken, Apr 5, 2018
    #6
Thema:

Set manual ip address from user input

Loading...
  1. Set manual ip address from user input - Similar Threads - Set manual address

  2. What can stop an IP Address being set manually

    in Windows 10 Gaming
    What can stop an IP Address being set manually: I am trying to set a static IP address in Win10 to be 192.168.0.1. When I look through the settings app, it shows the correct address. When I check the adapter properties through control panel, it shows the correct address. However running ipconfig shows the actual address is...
  3. What can stop an IP Address being set manually

    in Windows 10 Software and Apps
    What can stop an IP Address being set manually: I am trying to set a static IP address in Win10 to be 192.168.0.1. When I look through the settings app, it shows the correct address. When I check the adapter properties through control panel, it shows the correct address. However running ipconfig shows the actual address is...
  4. What can stop an IP Address being set manually

    in Windows 10 Network and Sharing
    What can stop an IP Address being set manually: I am trying to set a static IP address in Win10 to be 192.168.0.1. When I look through the settings app, it shows the correct address. When I check the adapter properties through control panel, it shows the correct address. However running ipconfig shows the actual address is...
  5. IP address conflict manual configuration

    in Windows 10 Network and Sharing
    IP address conflict manual configuration: Hi, We have about 100 players used for signage, with Windows 10 iot, where the IP V4 is configured manually on the computer. As we reboot the computers daily, and very often we get IP address conflict, and the machine is not accessible online anymore! If we restart the...
  6. Can't save IP address change in Manual

    in Windows 10 Network and Sharing
    Can't save IP address change in Manual: I am trying to connect to a NanoStation LocoM2 and after connecting an ethernet cable I'm instructed to change my ethernet connection on the laptop to Static.....problem is when I enter the IP address,, 192.168.1.5 and subnet of 255.255.255.0 and hit save the message "can't...
  7. Setting a persistent static IP address?

    in Windows 10 Ask Insider
    Setting a persistent static IP address?: Backstory: My HTPC runs Windows 10. Most of the time it's just running Kodi, but I also have a samba/network share up so that I can access my Music folder from around the house on my phone or laptop. The IP on that computer was previously set to a static IP (192.168.1.100,...
  8. IP Address.

    in Windows 10 Network and Sharing
    IP Address.: How do I find the IP address of mu computer (running W10)? https://answers.microsoft.com/en-us/windows/forum/all/ip-address/00092bb2-a514-4914-9938-3ca553c4e29a
  9. IP Address

    in Windows 10 Customization
    IP Address: How do I find the IP address of my desktop? https://answers.microsoft.com/en-us/windows/forum/all/ip-address/2bb05fc1-6350-45a4-bd4d-fdd5a278655e
  10. manually configure my IP address

    in Windows 10 Network and Sharing
    manually configure my IP address: I have the option to manually configure my IP address. How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/manually-configure-my-ip-address/c289c3ce-d847-4f79-913f-666842b36383