Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS Boot Disk

Status
Not open for further replies.

lpb71

Technical User
Mar 10, 2004
57
0
0
GB
I am creating a dos boot disk that will work with multiple NICs, also I would like the user to input what VLAN the system is in. I need a script that will prompt for the user to enter a VLAN, then edit the protocol.ini file and enter the ip address. ie if the user is in vlan 1 enter ip address as [1 1 1 1] and gateway as [2 2 2 2] any pointers would be greatly appreciated.
 
Worked out how to do this. See Below.

PRINT
BEGINNING:
PRINT "What number VLAN is you Machine in?"
PRINT
INPUT vlan$
PRINT "You entered VLAN "; vlan$; " - is this correct? y/n"
x$ = INPUT$(1)
IF x$ = "n" OR x$ = "N" THEN GOTO BEGINNING:

LET vlan1$ = "1 1 " + vlan$ + " 1"
'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
CLOSE #1
CLOSE #2
OPEN "i", 4, "c:\SCRIPTS\PROTOCOL.CHG"
OPEN "o", 5, "c:\SCRIPTS\PROTOCOL.INI"
WHILE NOT EOF(4)
LINE INPUT #4, a$
IF b$ <> "DefaultGateway0=changeme" THEN PRINT #4, b$
IF b$ = "DefaultGateway0=changeme" THEN PRINT #4, "DefaultGateway0="; vlan1$
WEND
CLOSE #3
CLOSE #4
 
I think you have an error in your code

IF b$ <> "DefaultGateway0=changeme" THEN PRINT #4, b$
IF b$ = "DefaultGateway0=changeme" THEN PRINT #4, "DefaultGateway0="; vlan1$

#4 was opened for input as I see it.
Also s/b
close #4
close #5

BTW lose LET. Noone uses it.
Not needed.

Most use
Open filename$ for opentype as #filenumber
i.e.

OPEN "c:\SCRIPTS\PROTOCOL.UPD" for input as #2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top