Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-11-2018, 02:54 PM
aramirez148 aramirez148 is offline
Registered User
 
Join Date: Jun 2018
Posts: 1
VBS Scripting newbie

I normally work in ProComm but am required to now use SecureCRT so I'm asking for a little help. I have a script that I need to create and have the basics of what I'm trying to do but am not sure how to script to read multiple lines from a text file and insert in a particular point in the script.

In the script below I need to read from a text file the phTYPE and the setTN and then repeat the Sub Main and read the next line in the text file for both phTYPE and set TN until the end of the text file
can I use one text file or are two required required?

any assistance would be much appreciated.


#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

' Begin script
' edited version 4

DIM phTYPE

' Enter Phone TYPE in quotes below
phTYPE = "2050PC"

Sub Main
crt.Screen.Send "****ld 20" & chr(13)
crt.Screen.WaitForString "REQ: "
crt.Screen.Send "chg" & chr(13)
crt.Screen.WaitForString "TYPE: "
crt.Screen.Send phTYPE & chr(13)
crt.Screen.WaitForString "TN "
crt.Screen.Send setTN & chr(13)
crt.Screen.WaitForString "ECHG "
crt.Screen.Send "yes" & chr(13)
crt.Screen.WaitForString "ITEM "
crt.Screen.Send "fdn 59248" & chr(13)
crt.Screen.WaitForString "ITEM "
crt.Screen.Send "hunt 59248" & chr(13)
crt.Screen.WaitForString "ITEM "
crt.Screen.Send "key 16 mwk 59990" & chr(13)
crt.Screen.WaitForString " KEY "
crt.Screen.Send chr(13)
crt.Screen.WaitForString "ITEM "
crt.Screen.Send chr(13)
End Sub

DIM setTN

' Enter the TN in quotes below
setTN = "252 1 15 29"
Reply With Quote
 

Tags
csv , file calling , script

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:34 AM.