Please Support by checking out some of the sponsors to the right

Wednesday, February 25, 2009

Use netsh command in batch file

Use netsh command in batch file

It is simple to use netsh command in a batch file. These files come with the extension .bat and can be used wherever you like. You can run all the commands with one click.

Open a note pad and type the desired netsh command. For example we want to execute the following commands in order
Then type
• netsh interface set ip address "Local Area Connection"
• netsh interface set ip address "Local Area Connection" dhcp.
• ipconfig

After typing this click save. In the save file dialogue box, you have to take care of one thing. Change file type to *.* and then type a file name.bat. Let us assume dhcp.bat. Save the file with this name and then close the notepad. Double click the file name and nothing will happen. Remember the Vista Hell. Right click on the file and cluck Run as Administrator. Success. Congrats.

You can make another .bat file let’s say static.bat a nd type the following commands
• interface set ip address "Local Area Connection 2" static 192.168.0.10 255.255.255.0 192.168.0.1
• ipconfig

You can run it in the same way and you will have used a batch file for execution of your commands.

Related

Change IP Address from Command Prompt








Search the Web:

No comments:

Post a Comment