Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 09, 2016, 05:20:04 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Execute a command line rather than just a program  (Read 1934 times)

pmoore

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 17
    • View Profile
    • Donate to Member
Execute a command line rather than just a program
« on: June 13, 2011, 08:52:25 AM »
For some uses, I'd like to be able to use FARR as a replacement for the Windows Run box (or Bayden SlickRun, or similar programs). In that situation, I want to be able to type a full command line, not just a program name. Two examples:
  • putty username@servername
  • gvim some.file.name

I know about the ++ syntax to add command line arguments, but in this case I don't want to have to type anything but the command line as it stands - my muscle memory is used to typing "putty xxx@yyy", so I want to stick with that. One option would be to have an alias executing "cmd ++ /c $$1" but (a) these are not console commands, so I'd rather avoid using the console, and (b) I can't get this to work anyway :-[

Is there a way of simply passing a command direct to Windows CreateProcess()? [For bonus points, if I could specify the working directory to use, that would be even better!] I'm pretty sure I could do this by writing a plugin - but do I need to?

Thanks,
Paul.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,430
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Execute a command line rather than just a program
« Reply #1 on: June 13, 2011, 11:16:05 AM »
You should be able to launch any command that you can normally run on the commandline by using the alias: run

So just type:
run putty username@servername
run gvim some.file.name


Now as for specifying working directory.. i'm afraid there is no easy way to do this currently, though it's not a bad idea and i could add it pretty easily.

you could also probably find a commandline tool that takes another commandline to run and a working directory and executes it; if you did find such a tool you could easily make your own run-like alias to do what you want.  let me know if you find an existing solution otherwise i might add it.
« Last Edit: June 13, 2011, 11:19:29 AM by mouser »

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,296
    • View Profile
    • www.StoicJoker.com
    • Donate to Member
Re: Execute a command line rather than just a program
« Reply #2 on: June 13, 2011, 06:40:27 PM »
@pmoore - Sorry about the off topic ... But I just noticed you Hong Kong Phooey avatar. I used to love that show!

Carry on...
 :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,669
    • View Profile
    • Donate to Member
Re: Execute a command line rather than just a program
« Reply #3 on: June 13, 2011, 07:17:34 PM »
But I just noticed you Hong Kong Phooey avatar. I used to love that show!

Likewise.  =]