I have written a qbasic script that will edit an ip address within a file depending on what value the script is run with. I can't get my script to accept an external value - ie c:\vlan.exe 10. sample of script below. (In example I want 10 to be passed to my script as the value for vlan$).
LET vlan1$ = "10 10 " + vlan$ + " 1"
LET vlan2$ = "10 10 " + vlan$ + " 8"
'OPEN "c:\SCRIPTS\PROTOCOL.UPD" FOR INPUT AS #2
OPEN "i", 2, "c:\SCRIPTS\PROTOCOL.UPD"
OPEN "o", 3, "c:\SCRIPTS\PROTOCOL.CHG"
WHILE NOT EOF(2)
LINE INPUT #2, a$
IF a$ <> "DefaultGateway0=changeme" THEN PRINT #3, a$
IF a$ = "DefaultGateway0=changeme" THEN PRINT #3, "DefaultGateway0="; vlan1$
WEND
LET vlan1$ = "10 10 " + vlan$ + " 1"
LET vlan2$ = "10 10 " + vlan$ + " 8"
'OPEN "c:\SCRIPTS\PROTOCOL.UPD" FOR INPUT AS #2
OPEN "i", 2, "c:\SCRIPTS\PROTOCOL.UPD"
OPEN "o", 3, "c:\SCRIPTS\PROTOCOL.CHG"
WHILE NOT EOF(2)
LINE INPUT #2, a$
IF a$ <> "DefaultGateway0=changeme" THEN PRINT #3, a$
IF a$ = "DefaultGateway0=changeme" THEN PRINT #3, "DefaultGateway0="; vlan1$
WEND