Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-12-2008, 03:53 AM
eddie666 eddie666 is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
problems passing argument to script

Hello ,

I'm trying to pass arguments to a script but it causes problems
example:

securecrt.exe /script "myScriptpath" /arg 10.10.10.10 /arg Cisco

securecrt v 6.02 opens halts for a while trying to connect to something and displays this error message (attached)

Does anyone knows why this is hapenning ?
Attached Images
File Type: jpg Error_Messege.JPG (10.0 KB, 281 views)
Reply With Quote
  #2  
Old 06-12-2008, 07:07 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Eddie666,

I'm sorry to hear that there are issues with the script.

Is it hard to say for certain what is causing the error to occur without seeing the script being used.

It appears that something is causing SecureCRT to attempt to connect to the script name as a host which is failing.

Could you provide a copy of the script being used?
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #3  
Old 06-12-2008, 11:29 AM
eddie666 eddie666 is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
The Script

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

Const CiscoUsername = "UserName"
Const CiscoPassword = "password"
Const JuniperUserName = "UserName"
Const JuniperPassword = "password"

Dim IPaDD
Dim Vendor
Dim screen ,session

Sub main()
Set screen = crt.screen
Set session = crt.session
If crt.Arguments.Count <> 2 Then
msgbox "ERROR"
Else

IPaDD = crt.arguments.GetArg(0)
Vendor = crt.arguments.GetArg(1)
MsgBox IPaDD
MsgBox Vendor
If Vendor = "Juniper" Then
Juniper_Connect(IPAdd)
Else
If Vendor = "Cisco" Then
Cisco_Connect(IpAdd)
End If
End If
End if
End sub


Public Function Juniper_Connect ( IPad )

Screen.synchronous = True
On Error Resume next
Session.Connect "/telnet " & IPad & " 23"
If Error.number <> 0 Then
retun false
End if
MsgBox IPad


Screen.waitforstring "ogin:"
Screen.send JuniperUserName & vbCr
Screen.waitforstring "assword:"
Screen.send JuniperPassword & vbCr
Screen.waitforstring ">"
Screen.send "edit" & vbCr
Screen.waitforstring "#"
'Session.disconnect

End Function


Public Function Cisco_Connect ( Ipad )
Screen.synchronous = True
On Error Resume next
Session.Connect "/telnet " & IPaD & " 23"
If Error.number <> 0 Then
return false
End if
Screen.waitforstring "sername:"
Screen.send CiscoUsername & vbCr
Screen.waitforstring "assword:"
Screen.send CiscoPassword & vbCr
Screen.waitforstring "#"
'Session.Disconnect
End Function
Reply With Quote
  #4  
Old 06-12-2008, 02:11 PM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Eddie666,

I think I do see what is happening.

It appears that the script path has a space in the path name which is causing the script path to be treated like a hostname.

Is the entire path and filename for the script being quoted?

For example:

SecureCRT /Script "c:\My Folder\My script.vbs"
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #5  
Old 06-13-2008, 12:20 AM
eddie666 eddie666 is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
Tnygren ,

thanks , actually i didn't used quotes so that's why it didn't worked
now it works

thanks for the support
Reply With Quote
  #6  
Old 06-13-2008, 07:47 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Eddie666,

I'm glad to hear that quoting the script path is working!

Please let us know if you have any other questions.
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
Reply

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 04:14 PM.