Need help - user button to run program

Discuss and share scripts and script files...
Post Reply
jacksonmacd
Posts: 35
Joined: 07 Dec 2011 05:33

Need help - user button to run program

Post by jacksonmacd »

Following (similar) directions from another post in this forum, I created a User button, and assigned this to its Run property:
run ("C:\Program Files\FreeFileSync\FreeFileSync.exe")

It displays an error when I click the button. "System cannot find the file specified." Yet when I paste the same thing into the Win7(64) Run box (of course, without the Run and parens), it runs properly. What do I need to change to get XY to run it?

Second question:
the FreeFileSync program accepts two folder names as commandline parameters. I would like to launch the program with the foldername of the Left and Right Panes respectively. Are those names available as variables to embed in the Run command?

Getting this to run would enable a capability that I was used to in PowerDesk before I discovered XY.

Thanks in advance.

Jack

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Need help - user button to run program

Post by highend »

Code: Select all

    $path = tab("get", "path");
    run """C:\Program Files\FreeFileSync\FreeFileSync.exe"" ""$path""";
Uses the path of the current focused tab.
One of my scripts helped you out? Please donate via Paypal

jacksonmacd
Posts: 35
Joined: 07 Dec 2011 05:33

Re: Need help - user button to run program

Post by jacksonmacd »

Thanks for the fast reply. That launches the program with one of the folders.
Is there a similar command for the path on the unfocused pane?

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Need help - user button to run program

Post by highend »

active pane:

Code: Select all

 get("path", a);  //active pane's path
inactive pane:

Code: Select all

 get("path", i);  //inactive pane's path
One of my scripts helped you out? Please donate via Paypal

jacksonmacd
Posts: 35
Joined: 07 Dec 2011 05:33

Re: Need help - user button to run program

Post by jacksonmacd »

Thanks very much!!

$path = tab("get", "path");
$pathi = get("path", i);
run """C:\Program Files\FreeFileSync\FreeFileSync.exe"" ""$path"" ""$pathi""";


Jack

Post Reply