Results 1 to 2 of 2

Thread: I want to create a TCP/IP Batch file

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    I want to create a TCP/IP Batch file

    Hello everybody !!!

    I need to create a batch file where I can change my TCP/IP settings, i.e., IP addresses.

    When I run that batch file it should ask in the following order one by one:

    1. IP Address
    2. Subnet Mask
    3. Default gateway
    4. Preferred DNS
    5. Alternate DNS

    My OS is WinXP SP3

    I read the following thread but it couldn't solve my problem.

    Create a simple IP Tool Batch File.

    I want to ask that when I copied the commands in notepad from the above link and ran the batch file then it asks LAN name. But I tried almost all names like Local Area Connection or LAN but it said "Local Area Connection, Lan" is wrongly specified or something like this. I want to know the name of LAN command.

    So I want a batch file and also the name of LAN which I should enter during running of batch file.

    Please someone help me.

    my email: aladdin2006@ymail.com

    thanks.

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: I want to create a TCP/IP Batch file

    Check the below examples:

    Code:
    1.@ECHO OFF
    2. 
    3.set varip=65.88.48.77
    4.set varsm=255.255.255.224
    5.set vargw=65.88.48.65
    6.set vardns1=66.78.202.254
    7.set vardns2=66.78.210.254
    8.set varhome=www.google.com
    9. 
    10.REM ***** You don’t need to change anything below this line! ******
    11. 
    12.ECHO This fanciness is brought to you by Saman Sadeghi!
    13.ECHO Setting IP Address and Subnet Mask
    14.netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
    15. 
    16.ECHO Setting Gateway
    17.netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1
    18. 
    19.ECHO Setting Primary DNS
    20.netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%
    21. 
    22.ECHO Setting Secondary DNS
    23.netsh int ip add dns name = "Local Area Connection" addr = %vardns2%
    24. 
    25.ECHO Setting Internet Explorer Homepage to %varhome%
    26.reg add "hkcusoftwaremicrosoftinternet explorermain" /v "Start Page" /d "%varhome%" /f
    27. 
    28.ECHO Here are the new settings for %computername%:
    29.netsh int ip show config
    30. 
    31.pause

Similar Threads

  1. how can i create a Batch file to kill some processes by name
    By Hansel Ortiz -[BrEcHaWarr] in forum Windows Server Help
    Replies: 7
    Last Post: 07-06-2012, 11:24 AM
  2. Create a simple IP Tool Batch File.
    By Bracken in forum Software Development
    Replies: 12
    Last Post: 11-12-2011, 04:33 PM
  3. Help me create this batch file.
    By bomblast in forum Windows Software
    Replies: 1
    Last Post: 31-10-2011, 10:47 AM
  4. How to create batch for RAR file extension
    By Jayden in forum Windows Software
    Replies: 1
    Last Post: 13-04-2009, 11:58 PM
  5. How to create a Batch file
    By Katty in forum Software Development
    Replies: 1
    Last Post: 10-01-2009, 12:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •