Jump to content

pass command line parameters to run Putty


Zeljo
 Share

Recommended Posts

Hi,

I am trying to implement launching Putty with AutoIt.

I have Putty configuration session I named it 'testcom11'. It saves Putty session with com11 and baudrate and so on.

I implemented in AutoIt line as :

Run ("putty -load testcom11")

It works fine. I was able to launch Putty with my session and Putty windows pops up and I was able to type 'AT' command to putty window.

Now I want , instead of to hard coded one session, to pass session from command line like this :

myAutoItprogram.exe testcom11


I put in AutoIt line :

$cmp = $CmdLine[1]

I can see it passed correctly when I print ( diplay in , let's say, MsgBox) $cmp it shows testcom11.

In next line I have :

Run ("putty -load $cmp")

However AutoIt launches Putty only with window asking me to load session. So clearly
it didn't read -load $cmp option.

As you can see I am novice to AutoIt, so if you can see if it is something with how it handles $cmp in Run Window or something else.

Thank you in advance,
Zeljo

Link to comment
Share on other sites

Hi,

Welcome to the autoit forum :)

The variables are not interpreted like in PHP whenever they are in a string.

Please have a look at the help file, or debug your script with a MsgBox or ConsoleWrite to see that it's not working the way you want.

Run("putty -load " & $cmp)
NB: use autoit code tags to post your code ;)

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...