open multiple tab from command line

Discussion and questions - donor version.
Post Reply
Message
Author
raffamaiden
Posts: 6
Joined: 05.08.2012, 18:23

open multiple tab from command line

#1 Post by raffamaiden » 05.08.2012, 18:29

I have free commander XE version 591 public preview. I want to open multiple tabs in the left pane from the command line. in the FAQ there is only a way to open a single tab. I have tried concatenating the different paths in the /L= options but have no success

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: open multiple tab from command line

#2 Post by BGM » 05.08.2012, 19:19

You can do it with AutoHotkey or Powerpro, actually, but you have to do a few tricks (such as send the hotkey to FC for "Open New Tab" and then "Go To Folder". If you want to do it via commandline, you have to send the commandline multiple times, but it won't create a new tab, I think. If you put this into a batch file, it should open all three folders in your FC.

SET LOCAL
SET fc =c:\freecommanderxe\freecommander.exe
%fc% /L = "c:\my folder\somefolder"
%fc% /L = "c:\my folder\someotherfolder"
%fc% /L = "c:\another folder\yet another folder"

Also, look here: viewtopic.php?f=6&t=3811
(Windows 10-1909 Professional 64bit)

raffamaiden
Posts: 6
Joined: 05.08.2012, 18:23

Re: open multiple tab from command line

#3 Post by raffamaiden » 06.08.2012, 11:14

The batch script you posted does not work. it opens the first instance of FreeCommander, but then the second command is executed only AFTER the first command has ended, that means you close the instance of FreeCommander already running.

I have tried to set the Freecommander options to have only one instance running at any time, then i Have modified your batch script to run FreeCommander using the START command

Code: Select all

START "" "%fc%" /L="c:\my folder\somefolder"
START "" "%fc%" /L="c:\my folder\someotherfolder"
This does not work to. THe instance of FreeCommander is only one, but after the first command, the second command will change the current open tab to the new tab instead of opening a new tab with the new folder.

The AutoHotkey scripts you pointed me to doesn't work too. The FCdir keep saying that "C does not exist", while i passed it with something like "C:\data\polimi". The FCnewtab open just a new tab without changing folder

Karol
Posts: 963
Joined: 19.08.2007, 12:05

Re: open multiple tab from command line

#4 Post by Karol » 06.08.2012, 12:19

In the current release (597) I can open new tab with:

/T /L="c:\my folder\somefolder"

raffamaiden
Posts: 6
Joined: 05.08.2012, 18:23

Re: open multiple tab from command line

#5 Post by raffamaiden » 06.08.2012, 13:04

Hey that works, thanks Karol!

So, to make a summary

1) Open FreeCommanderXE, go to Tools->Settings, in the "General" tab check on the "Allow only one instance (needs restart)" option. Close FreeCommanderXE

2) Use the following script to open FreeCommanderXE with user customized multiple tabs. you need to change the FreeCommander path with the one matching for you and of course the folders you want to open

Code: Select all

@echo off
SET fc="C:\software\FreeCommanderXE\FreeCommander.exe"
START "" %fc% /T /L="C:\folder1\subfolder1"
timeout 5
START "" %fc% /T /L="C:\folder2\subfolder2"
You can also experiment with less sleep seconds

EDIT: "timeout 1" works for me for the following folders, because FreeCommanderXE is already open

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: open multiple tab from command line

#6 Post by BGM » 06.08.2012, 15:51

You are right about my poor batch script. I apologize for that.

Try my FCmenu.ahk script. You can open multiple folders in tabs from the commandline, that is, if you have authotkey installed. But it will open in the currently active pane, not just the left pane. I use this script myself.

viewtopic.php?f=6&t=3811&p=11227#p11227
(Windows 10-1909 Professional 64bit)

raffamaiden
Posts: 6
Joined: 05.08.2012, 18:23

Re: open multiple tab from command line

#7 Post by raffamaiden » 08.08.2012, 10:33

BGM wrote:You are right about my poor batch script. I apologize for that.

Try my FCmenu.ahk script. You can open multiple folders in tabs from the commandline, that is, if you have authotkey installed. But it will open in the currently active pane, not just the left pane. I use this script myself.

viewtopic.php?f=6&t=3811&p=11227#p11227
I didn't understand. The FCmenu.ahk description says
Attach this script to a global hotkey! It will display a menu of all the folder paths from tabs currently open in FreeCommander. The active tabs' paths will be checkmarked for easy visual sighting. When you select the item, the path is copied to the clipboard. This works even if FC is not running.
As i said previously, I have tried your FCdir.ahk (may is this the script you meant?), i have called it like

Code: Select all

FCdir.ahk "C:\path\path2\path3"
from the command line, after of course have installed AutoHotkey_L, but a message box pops up inside FreeCommander that says that "C does not exist" (or is not a valid path, do not remember). First a new tab is created, then folder->"Go to folder" text box appears, and then the message box previously said pops up. Maybe for me your script click on "ok" before it completely write the folder string on the text box, but I'm not sure.

BTW with my current solution I have problems too, because I made Windows run the script at startup automatically, to open a set of folders in multiple tabs I often use. The problem is that I have also other software running at startup of course, so I have a trade off between less sleep time which means that the script do not work because it sends the command to open a new tab before the last command (to open FreeCommander) has ended its execution, meaning it has no effect, and greater sleep times which of course increase start-up time.

I think that developers should implement this directly, so you can open multiple folders in multiple tabs with only one string of command line (like separating the folders with commas after the /L or /R or something like that). I have PDFXChange Viewer and it works like this beatifully. At startup I just run one string of command line and it is executed "in one step" when ready, without needing for arbitrary guessed sleep times.

Karol
Posts: 963
Joined: 19.08.2007, 12:05

Re: open multiple tab from command line

#8 Post by Karol » 08.08.2012, 11:27

BTW with my current solution I have problems too, because I made Windows run the script at startup automatically, to open a set of folders in multiple tabs I often use
You could simply define the tabs with your often used folders as "Locked". Locked tabs are not closed, when the program ends and they will be opened again if you start the program.

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: open multiple tab from command line

#9 Post by BGM » 08.08.2012, 15:26

Sorry, doing too many things at once and getting discombobulated. You found the FCdir script - that is the right one.
from the command line, after of course have installed AutoHotkey_L, but a message box pops up inside FreeCommander that says that "C does not exist" (or is not a valid path, do not remember). First a new tab is created, then folder->"Go to folder" text box appears, and then the message box previously said pops up. Maybe for me your script click on "ok" before it completely write the folder string on the text box, but I'm not sure.
Hmmm. It works fine for me.
If there are spaces in the path of the folder, you need to enclose the path in double quotes (you probably know that).
Now, you might try playing with the delay in the script. I have a pretty fast computer.

Indeed, it opens a new tab,
then it opens the "go to folder" dialogue in FC
then it sends the path to the dialogue box.
(Windows 10-1909 Professional 64bit)

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: open multiple tab from command line

#10 Post by BGM » 08.08.2012, 15:29

If you just want FC to start with particular folders open, there is an option for that you know,
go to Tools>Settings>Start Program>Start/TEMP folder
You can decide what folders to start with in each panel.
(Windows 10-1909 Professional 64bit)

Post Reply

Who is online

Users browsing this forum: No registered users and 50 guests