View Single Post
  #6  
Old 07-12-2007, 02:01 PM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi 1720,

That does explain the error message.

In this case, it may be better to pass the arguments to the script and then use them in the script.

A simple example of a script that will message box the arguments passed to it would be:

Code:
Main

Sub Main()
    If WScript.Arguments.Count > 0 then
        For nIndex = 1 to WScript.Arguments.Count
            szArgs = szArgs & vbcrlf & "Arg #" & nIndex & ": " & WScript.Arguments(nIndex - 1)
        Next
    else
        szArgs = "(No args specified for this script)"
    end if
    MsgBox "Arguments sent to this script include: " & vbcrlf & szArgs
End Sub
Since the arguments are already in the Arguments array, these could be used to create the ssh command line.

Since the arguments would contain several parts of the ssh command, he arguments would need to be entered in the same order each time. If they weren't, then there would be issues constructing the command line.

As this is a VBScript option, more information on the Arguments array can be found on Microsoft's scripting help pages.

Would this be an option that could help?
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote