View Single Post
  #13  
Old 10-14-2008, 02:47 AM
nxg nxg is offline
Registered User
 
Join Date: Sep 2008
Posts: 8
OK, here's the script (username and password obscured, but have been checked as correct). I've re-installed the program from scratch, having cleared out all files and registry entries from the previous install. A screenshot of the error message is attached.

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

Sub Main

Const username = "xxxxxx" ' Username to use for login
Const password = "xxxxxx" ' Password for corresponding user

Const DEVICE_FILE_PATH = "C:\Program Files\SecureCRT\Scripts\sessionlist.txt"
'10
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

Dim fil
Set fil = fso.OpenTextFile(DEVICE_FILE_PATH)

Dim ip
Dim cnxnString

'On Error Resume Next

While Not fil.AtEndOfStream

ip = fil.ReadLine
MsgBox "IP address is: " & ip
cnxnString = "/SSH2 /L & /AcceptHostKeys " & username & " /PASSWORD " & password & ip

' Connect

crt.Screen.Synchronous = True
' 31
crt.Session.Connect cnxnString

crt.Screen.WaitForString "#"

crt.Screen.Send "dir " & vbCr

crt.Screen.WaitForString "#"

crt.Screen.Synchronous = False

crt.Session.Disconnect

Wend

fil.Close

End Sub
Attached Images
File Type: jpg test2 error.JPG (37.7 KB, 255 views)
Reply With Quote