QuickSwitch and JumpToFolder AHK scripts
Moderators: Hacker, petermad, Stefan2, white
Re: QuickSwitch and JumpToFolder AHK scripts
TC didn't add environmental variables. This means that other users may not have them! These are difficult steps just to make sure.
My script works externally and cannot be run from TC. so it can't access variables?..
My script works externally and cannot be run from TC. so it can't access variables?..
Re: QuickSwitch and JumpToFolder AHK scripts
2Rafaello
TC definitely adds the environment variables for its current process. They're NOT added for the user or even system-wide. You won't see them in Windows control panel. But you will be able to see them when launching a CMD from a TC instance and use the "set" command as Horst.Epp suggested. Another way to see them is to use Process Hacker or Process Explorer and check the environment variables of the running totalcmd.exe/totalcmd64.exe process via the "Environment" tab.
One important thing is that there's not just one set of environment variables like in the old days in DOS. Each process can have its own set of them. And child processes inherit the environment variable set (usually).
Anyway, if your tool is not launched from a running TC, its environment variables won't be helpful in any way.
TC definitely adds the environment variables for its current process. They're NOT added for the user or even system-wide. You won't see them in Windows control panel. But you will be able to see them when launching a CMD from a TC instance and use the "set" command as Horst.Epp suggested. Another way to see them is to use Process Hacker or Process Explorer and check the environment variables of the running totalcmd.exe/totalcmd64.exe process via the "Environment" tab.
One important thing is that there's not just one set of environment variables like in the old days in DOS. Each process can have its own set of them. And child processes inherit the environment variable set (usually).
Anyway, if your tool is not launched from a running TC, its environment variables won't be helpful in any way.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: QuickSwitch and JumpToFolder AHK scripts
TC create the variable for the current process and you an access it using the getenv. Even if your main tool cannot run inside TC you can have secondary script launched inside TC to do the configuration or communicate with it. Some TC USER are conservative and prefer to do manual change than having other tools changing configuration or command files without notice.Rafaello wrote: 2025-04-09, 06:06 UTC TC didn't add environmental variables. This means that other users may not have them! These are difficult steps just to make sure.
My script works externally and cannot be run from TC. so it can't access variables?..
Re: QuickSwitch and JumpToFolder AHK scripts
That's bad: script should be fully automatic.Dalai wrote: 2025-04-09, 06:36 UTC Anyway, if your tool is not launched from a running TC, its environment variables won't be helpful in any way.
The script doesn't change or break anything. It should be fully automatic: the user doesn't have to do anything. I'll think about how to read CMD contents from TC to access process variables autonomously...
Re: QuickSwitch and JumpToFolder AHK scripts
The original Quick Switch has no need for any script from inside of supported file managers.Rafaello wrote: 2025-04-09, 10:03 UTCThat's bad: script should be fully automatic.Dalai wrote: 2025-04-09, 06:36 UTC Anyway, if your tool is not launched from a running TC, its environment variables won't be helpful in any way.
The script doesn't change or break anything. It should be fully automatic: the user doesn't have to do anything. I'll think about how to read CMD contents from TC to access process variables autonomously...
It runs in the background, detects Open/Save dialogs
and queries the running file managers without changing anything of their settings.
That way it works perfect.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: QuickSwitch and JumpToFolder AHK scripts
It can't display all paths. New QS has completely new fast and useful core.
Re: QuickSwitch and JumpToFolder AHK scripts
I want to select all the paths from TC, and this variety of possible wincmd.ini locations is very difficult to track. That's why I'm asking for help with Automation...
Re: QuickSwitch and JumpToFolder AHK scripts
Personally, I only want to see the current source and target directories of all open TC windows (XY or Opus). I do not want to see directories from all TC tabs from both sides.It can't display all paths. New QS has completely new fast and useful core.
Joe
Central Illinois, USA
Central Illinois, USA
Re: QuickSwitch and JumpToFolder AHK scripts
This app will improve and display more features. I need help getting the TC configuration.
Re: QuickSwitch and JumpToFolder AHK scripts
2Rafaello
You can get the current open/active locations in TC via WM_COPYDATA, but I assume you know that already. I doubt that it's possible to read the location of all (or inactive) open tabs. What kind of (other) TC configuration did you have in mind?
You can get the current open/active locations in TC via WM_COPYDATA, but I assume you know that already. I doubt that it's possible to read the location of all (or inactive) open tabs. What kind of (other) TC configuration did you have in mind?
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: QuickSwitch and JumpToFolder AHK scripts
If you add a custom command to usercmd.ini that executes the internal "SaveTabs2" command, Total Commander exports all tabs to a file that can be read: https://github.com/JoyHak/QuickSwitch/blob/fc3b39608920eca5850663fe384a9c1b759313ee/Libs/GetPaths.ahk#L250Dalai wrote: 2025-04-10, 08:41 UTC I doubt that it's possible to read the location of all (or inactive) open tabs. What kind of (other) TC configuration did you have in mind?
The problem turned out to be that the path to the usercmd.ini configuration directly depends on the path of wincmd.ini. The user can change this path. So in order to create a usercmd.ini and Total Commander could read it, you need to get the path to wincmd.ini.
I don't understand how to get this path. The script is currently searching for this path in the current TC directory or taking the path from the registry: https://github.com/JoyHak/QuickSwitch/blob/fc3b39608920eca5850663fe384a9c1b759313ee/Libs/GetPaths.ahk#L216
Re: QuickSwitch and JumpToFolder AHK scripts
There are a lot of locations where the wincmd.ini can be and how it's named. I'm not sure if there already is an explanation on the forum, but I'm not in the mood to search for it, so I'm just gonna write down how TC finds its configuration file. Maybe it's time to add a more recent post about this topic anyway.Rafaello wrote: 2025-04-10, 13:41 UTCI don't understand how to get this path. The script is currently searching for this path in the current TC directory or taking the path from the registry
- If TC is started with the /i switch it overrides any other location where the config file can be, including the one in the TC directory. In this mode, the file can have any custom name.
- If there's no /i switch, TC checks for a wincmd.ini in the TC directory. If it's present, it'll check if setting is present, and if it is (and its value is large enough), the wincmd.ini in the TC directory will be used regardless what the registry specifies. This is kind of a portable mode and is usually used for exactly that.
Code: Select all
[Configuration] UseIniInProgramDir
- When neither of the above is true, TC will check the registry (HKCU and HKLM) if a location is specified there. If there is one, TC uses that.
- If all of the above fail (no /i, no wincmd.ini in TC directory and no registry) TC will fall back to a default location. On Windows versions since Vista (IIRC) this will be %AppData%\Ghisler, on older Windows versions it might be %SystemRoot% (or %WindowsDir%).
PS: I hope I didn't forget anything in the list above. If I did, I'm sure others will chime in and correct me. Please feel free to do so

#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: QuickSwitch and JumpToFolder AHK scripts
It's even more complicated.
The user may not like entries in Usercmd.ini
but in its menu config related ini file under the Language subdir.
This is used in Petermad's configs, for example.
For me, it's wcmd_MyTCMenu_ENG.INI
The simple solution for all this was already suggested.
Tell the user what em_command and content to create.
In this case, there is no need for the QS script to do anything on its startup.
The user may not like entries in Usercmd.ini
but in its menu config related ini file under the Language subdir.
This is used in Petermad's configs, for example.
For me, it's wcmd_MyTCMenu_ENG.INI
The simple solution for all this was already suggested.
Tell the user what em_command and content to create.
In this case, there is no need for the QS script to do anything on its startup.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: QuickSwitch and JumpToFolder AHK scripts
This is the help I was looking for, thank you so much! I can read the contents of the startup parameters (including the /i=name.ini parameter) and find the desired configuration.Dalai wrote: 2025-04-10, 15:11 UTC I hope I didn't forget anything in the list above. If I did, I'm sure others will chime in and correct me. Please feel free to do so.
The function is quite complex, but it is executed once when the application is launched, and therefore it is not scary.
Re: QuickSwitch and JumpToFolder AHK scripts
This means that I will send requests to open CMD in TC and read its contents after executing some commands. This is an alternative that I found as an addition to the steps described above.
Where did you change the configuration name?