Computing.Net > Forums > Programming > Batch file and netsh.exe

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

Batch file and netsh.exe

Reply to Message Icon

Name: Crash_edwards
Date: January 14, 2009 at 11:42:01 Pacific
OS: Windows 2003 server
CPU/Ram: Xeon 3.0/1024MB
Manufacturer/Model: Hewlett-packard / DL 380 G5
Subcategory: Batch
Comment:

I have a text file that will have 2 entries per line. They are servername and a IP address. I would like to create a batch file that would parse each line in the text file to be fed into two variables (one for server name one for the ip address) and then feed these into netsh.

The text file would look like this:
server1 10.0.0.1
server2 10.0.0.2
server3 10.0.0.3

The netsh command is:
netsh wins server \\winsserv1 add name name=%var1% IP={%var2%}

Is there any way to create a batch file to do this?


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: Crash_edwards
Date: January 14, 2009 at 13:05:14 Pacific
Reply:

Nevermind I am an idiot I had a typo in my for statement for delims...


Report Offensive Follow Up For Removal
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file and netsh.exe

Make an exe with a batch file and.. www.computing.net/answers/programming/make-an-exe-with-a-batch-file-and/17595.html

Batch files and serial ports? www.computing.net/answers/programming/batch-files-and-serial-ports/16989.html

i created a batch file and i'm invoking three www.computing.net/answers/programming/i-created-a-batch-file-and-im-invoking-three/19013.html