Hello, I would like to be able to put this command to a batch file:
Route add 192.168.3.0 mask 255.255.255.0 192.168.5.12 metric 30 -p
Here is what I have so far, and get an error on add.
Anyone have any suggestions?
Thank you
@ECHO OFF
if "%1"=="3" goto Route2
if "%1"=="4" goto Route2
:ERR
ECHO Type in Printer value first, followed by the last two numbers of the IP address.
ECHO routeprinter 4 5.12
goto END
:Route2
if "%2"=="" goto ERR
Route add 192.168.%1.0 mask 255.255.255.0 192.168.%2 metric 30 -p
goto END
:END
@ECHO ON
Create a batch file for routing a printer
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Create a batch file for routing a printer
Doesn't look like anything wrong with the script.
Btw, the goto END on the bottom isn't necessary.
Btw, the goto END on the bottom isn't necessary.