Question : script the NETSH commands

I need to enter the commands below in batch file. how can I do that?
I tried it but it just open Netsh window and stays there.

Adding DHCP option 60 to Windows 2003 DHCP server
By default, option 60 is not set on Windows® 2003. If the OS deployment server is running on the same host as the DHCP server, you have to add this option and set its value to PXEClient in order to tell PXE clients where to find the OS deployment server.
Open a command window.
Enter netsh
Enter dhcp 4.
Enter server \\hostname or server ip_address. A command prompt that says: dhcp server> is displayed.
Enter add optiondef 60 PXEClient STRING 0 comment=option added for PXE support
Enter set optionvalue 60 STRING PXEClient
To confirm that everything has been set correctly, enter:
show optionvalue all

Answer : script the NETSH commands

If you have the pc configured the way you want it.  You can dump the config to a file using "netsh dump>c:\file.txt", then in your batch file execute the file "netsh exec c:\file.txt".  

If that isnt an option, Im not exactly sure of the syntax of the netsh command and cant test your commands because I dont have a 2003 server to test on.  You can try to concatenate the commands together in the batch like so:

netsh dhcp 4 server \\hostname add optiondef 60 PXEClient STRING 0
netsh dhcp 4 server \\hostname set optionvalue 60 STRING PXEClient
netsh dhcp 4 server \\hostname show optionvalue all



Random Solutions  
 
programming4us programming4us