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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - Printer config script 1

Status
Not open for further replies.

AGNEW2PRG

Technical User
Aug 5, 2003
98
AE
Hi

I am in the process of writing a script to conmfigure network printers. I have a config.inf file that contains all the setting. The scripts works to the extent of reading the config.inf file and the lines in it. I am trying to get the script to split the line at the ":" and use the rest of the string as a variable to the right of the ":". This is what i have so far.

I am trying to set the WINSSERVER1 Ipaddress variable from the config file.

<------- Script ------->

if isobject(FSO) Then
Set cfgFILE = FSO.Opentextfile("C:\CONFIG.INF")
end If

dim strValue, WINSSERVER1
while not cfgFILE.atendofline
strValue = cfgFILE.readline

If InStr((strValue),"WINSSERVER1") Then
Split(strValue,":")
WINSSERVER1 = XXX.XXX.XXX.XXX -----------------------> This Is the bit i cant Get working
End If
Wend

cfgFILE.close
set FSO=Nothing
set cfgFILE=Nothing

<---------- end script -------------->

Any assistance will be much appreciated..

Many Thanks
 
how many : are in the string?
if you only want the 2nd part then
If Instr("x:yy", ":") Then
aArray = Split("x:yy", ":")
Msgbox aArray(1)
End If
 
Thanks MrMovie,

This worked, BTW I have only ":" in the line

Thanks once again

" New To Programming - Learning Fast :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top