Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Run exe with parameters?


  • Please log in to reply
5 replies to this topic
erikcw
  • Members
  • 15 posts
  • Last active: Aug 06 2006 03:31 PM
  • Joined: 18 Jan 2006
Hi,

I'm trying to figure out how I can Run Putty from AHK. Here is the Full command I want to run:
Run "C:\Program Files\Putty\putty.exe -load "ssh.theserver.com" -l myuser -pw ********"

The second set of double "" seem to be breaking the Run command. Any ideas on how I can make this work?

Thanks!

AGU
  • Guests
  • Last active:
  • Joined: --
Have a try with %comspec%. S.th like

RunWait, %comspec% /c "C:\Program Files\Putty\putty.exe -load "ssh.theserver.com" -l myuser -pw ********"

Concerning the correct syntax you will have to check the help page of cmd.exe. I can't help you on that, sorry.
_________________________
Cheers
AGU

erikcw
  • Members
  • 15 posts
  • Last active: Aug 06 2006 03:31 PM
  • Joined: 18 Jan 2006
Thanks for the response. I acctually already tried comspec. No luck :-( I've tried it with both /c and /k.

Is there anything else I can try?

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Have a look at this topic :) .

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
I would try:
Run C:\Program Files\Putty\putty.exe -load "ssh.theserver.com" -l myuser -pw ********
Ie. no double quotes were not needed.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

erikcw
  • Members
  • 15 posts
  • Last active: Aug 06 2006 03:31 PM
  • Joined: 18 Jan 2006
Thanks for all your help!!!

I ended up with this:
Run "C:\Program Files\Putty\putty.exe" -load "server" -l user -pw pass

Works great!

Now I'm thinking - maybe I should compile this to keep the passwords safe. Right now it's in my ini file.

Is it possible to do an exe include? I have a couple of these that I want to compile into the script. Is it possible to make it into a function, and then
Run compiledAHK.exe server1 ;executes the first servers putty

Thanks again!