; Route ; ----- ; A GUI front end for the ROUTE command. Note code to deal with idiosyncracy of Route command. ; To display routes, output of ROUTE PRINT is redirected to temp.txt. However, first part of ; output uses LF rather than CR-LF to end lines. SpltStr is used to split on LF and substitute ; CR-LF in output to temp1.txt. Note also that ROUTE command sends all error messages to the ; error output rather than console output - error can't be redirected to a file so can't ; display or process errors from ROUTE within script. Finally, note use of getclip command ; in route delete processing - can copy an address from route display which will be automatically ; pre-loaded into the delete IP box. ; :start menubox Route Configuration,Select a function,Display Routing table|Add Route|Change Route|Delete Route setvar D,%M casemsg exit|display|add|change|delete goto exit :add ipbox Route Configuration,Enter route to add,A setvar B, ipbox Route Configuration,Enter mask (or leave blank),B ifvar B,...,nomask setvar B,MASK %B goto dogate :nomask setvar B, :dogate ipbox Route Configuration,Enter gateway,C dos route.exe ADD %A %B %C,,X|X,,ROUTE wait ROUTE,10 iferror prob while ROUTE goto start :change ipbox Route Configuration,Enter route to change,A setvar B, ipbox Route Configuration,Enter mask (or leave blank),B ifvar B,...,nomask1 setvar B,MASK %B goto dogate1 :nomask1 setvar B, :dogate1 ipbox Route Configuration,Enter new gateway,C dos route.exe CHANGE %A %B %C,,X|X,,ROUTE wait ROUTE,10 iferror prob while ROUTE goto start :delete getclip E ipbox Route Configuration,Enter route to delete,A,%E dos route.exe DELETE %A,,X|X,,ROUTE wait ROUTE,10 iferror prob while ROUTE goto start :display dos route.exe PRINT > temp.txt,,X|X,,ROUTE wait ROUTE,10 iferror prob while ROUTE savetext ,temp1.txt readline temp.txt,A :loop iferror show :loop1 dbgbox Before: A - %A spltstr %A,`\n`,A,B dbgbox After: A - %A B - %B iferror go-on savetext %A`\r\n`,temp1.txt,A setvar A,%B goto loop1 :go-on ;savetext %A`\r\n`,temp1.txt,A nextline temp.txt,A goto loop :show setfont lucida console,8 infobox Route Information,temp1.txt,C|C,600|300 setfont DEFAULT goto start :prob msgbox Route Configuration,Unable to set route,0 :exit delfile temp.txt delfile temp1.txt