add hash class extended command parameters for Button Bar
Moderators: Hacker, petermad, Stefan2, white
add hash class extended command parameters for Button Bar
It is recommended to add hash class extended command parameters, for example, I need to set the parameter "--disk-cache-dir =%TEMP%\ChromiumCache%RANDOM%" for the Chromium class browsers
Re: add hash class extended command parameters for Button Bar
And what prevents you from doing that in currrent TC?
You do know that if you want to put environment variables in the "Parameters:" field of a button you have to double the %-signs - like:
If you use the parameter in the "Command:" field you just use ordinary single %-signs.
You do know that if you want to put environment variables in the "Parameters:" field of a button you have to double the %-signs - like:
Code: Select all
--disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: add hash class extended command parameters for Button Bar
I'd try both like "D:\ChromiumCache%%RANDOM%%" & "D:\ChromiumCache%RANDOM%", but I got the folder "D:\ChromiumCache%RANDOM%" twicepetermad wrote: 2020-04-18, 20:24 UTC And what prevents you from doing that in currrent TC?
You do know that if you want to put environment variables in the "Parameters:" field of a button you have to double the %-signs - like:If you use the parameter in the "Command:" field you just use ordinary single %-signs.Code: Select all
--disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
- ghisler(Author)
- Site Admin
- Posts: 50400
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: add hash class extended command parameters for Button Bar
If you put environment variables in double % signs in the parameters field, they will NOT be resolved by Total Commander. They will be passed with single % signs to the target application. It's then the duty of the target application to resolve them.
If you want to resolve environment variables in Total Commander, you need to put them in the "command" field. This field also accepts command line paramters as long as you properly quote names containing spaces.
If you want to resolve environment variables in Total Commander, you need to put them in the "command" field. This field also accepts command line paramters as long as you properly quote names containing spaces.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: add hash class extended command parameters for Button Bar
2thomasmo
There are three options:
Either
Command: drive:path\yourprogram --disk-cache-dir=%TEMP%\ChromiumCache%RANDOM%
OR:
Command: %COMSPEC% /C start "" "drive:path\yourprogram"
Parameter: --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
OR:
Command: %COMSPEC% /C
Parameter: start "" "drive:path\yourprogram" --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
But did you use "D:\ChromiumCache%RANDOM%" in the Command field?I'd try both like "D:\ChromiumCache%%RANDOM%%" & "D:\ChromiumCache%RANDOM%", but I got the folder "D:\ChromiumCache%RANDOM%" twice
There are three options:
Either
Command: drive:path\yourprogram --disk-cache-dir=%TEMP%\ChromiumCache%RANDOM%
OR:
Command: %COMSPEC% /C start "" "drive:path\yourprogram"
Parameter: --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
OR:
Command: %COMSPEC% /C
Parameter: start "" "drive:path\yourprogram" --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- thomasmolover
- Member
- Posts: 177
- Joined: 2016-12-12, 01:32 UTC
Re: add hash class extended command parameters for Button Bar
thank youpetermad wrote: 2020-04-20, 12:48 UTC 2thomasmoBut did you use "D:\ChromiumCache%RANDOM%" in the Command field?I'd try both like "D:\ChromiumCache%%RANDOM%%" & "D:\ChromiumCache%RANDOM%", but I got the folder "D:\ChromiumCache%RANDOM%" twice
There are three options:
Either
Command: drive:path\yourprogram --disk-cache-dir=%TEMP%\ChromiumCache%RANDOM%
OR:
Command: %COMSPEC% /C start "" "drive:path\yourprogram"
Parameter: --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
OR:
Command: %COMSPEC% /C
Parameter: start "" "drive:path\yourprogram" --disk-cache-dir=%%TEMP%%\ChromiumCache%%RANDOM%%
I just would not want to a commander windows flash beforce launch app either use some app like AHK to do it
- thomasmolover
- Member
- Posts: 177
- Joined: 2016-12-12, 01:32 UTC
Re: add hash class extended command parameters for Button Bar
I'd put the %random% in "command" field, but it pass a "%" symbol to the commander but not get environment variables.ghisler(Author) wrote: 2020-04-19, 08:14 UTC If you put environment variables in double % signs in the parameters field, they will NOT be resolved by Total Commander. They will be passed with single % signs to the target application. It's then the duty of the target application to resolve them.
If you want to resolve environment variables in Total Commander, you need to put them in the "command" field. This field also accepts command line paramters as long as you properly quote names containing spaces.
I test the command in AHK like this
Code: Select all
for n, param in A_Args
{
MsgBox Parameter number %n% is %param%.
}
ExitApp
so I test command:
test.exe %random%
If I put "%random%" in command field, it shown "%random%"
if put "%random%" in parameter field, "%r" get the filename with focus in the target window, and "andom" follow it, just like "tempandom" etc.
Re: add hash class extended command parameters for Button Bar
2thomasmolover
Use an leading ? question sign in the Parameters box to see what TC will pass to AHK.
COMMAND: xxxxx\AHK\AutoHotkey.exe xxxx\ShowParameters.ahk
PARAMETERS: ?%%TEMP%% ### %%RANDOM%%
>>>?-DIALOG Shows: %TEMP% ### %RANDOM%
>>>OUTPUT: nothing (probably %...% are variables in AHK, and that non-existing vars in the script result in empty string)
Also passing %var% to an VBS script for example
For i = 0 to WScript.Arguments.Count -1
MsgBox WScript.Arguments.Item(i)
will not automatically expand the vars, because VBS doesn't know what you want from it.
You can pass %var%s and then handle (expand) them inside the script by using VBS functions to do that.
With CMD it will work:
COMMAND: cmd /k
PARAMETERS: ?Echo %%TEMP%% # # # %%RANDOM%%
>>>?-DIALOG Shows: Echo %TEMP% # # # %RANDOM%
>>>OUTPUT: C:\Users\Stefan2Einer\AppData\Local\Temp # # # 20050
So your program can not handle environment variables (at least not that way).
Solution: Just call a ahk script from your button, use there the EnvVars you want (or utilize AHK functions) and call your application from there.
It's then the duty of the target application to resolve them.ghisler(Author) wrote: 2020-04-19, 08:14 UTC If you put environment variables in double % signs in the parameters field,
they will NOT be resolved by Total Commander.
They will be passed with single % signs to the target application.
It's then the duty of the target application to resolve them.
Use an leading ? question sign in the Parameters box to see what TC will pass to AHK.
COMMAND: xxxxx\AHK\AutoHotkey.exe xxxx\ShowParameters.ahk
PARAMETERS: ?%%TEMP%% ### %%RANDOM%%
>>>?-DIALOG Shows: %TEMP% ### %RANDOM%
>>>OUTPUT: nothing (probably %...% are variables in AHK, and that non-existing vars in the script result in empty string)
Also passing %var% to an VBS script for example
For i = 0 to WScript.Arguments.Count -1
MsgBox WScript.Arguments.Item(i)
will not automatically expand the vars, because VBS doesn't know what you want from it.
You can pass %var%s and then handle (expand) them inside the script by using VBS functions to do that.
With CMD it will work:
COMMAND: cmd /k
PARAMETERS: ?Echo %%TEMP%% # # # %%RANDOM%%
>>>?-DIALOG Shows: Echo %TEMP% # # # %RANDOM%
>>>OUTPUT: C:\Users\Stefan2Einer\AppData\Local\Temp # # # 20050
So your program can not handle environment variables (at least not that way).
Solution: Just call a ahk script from your button, use there the EnvVars you want (or utilize AHK functions) and call your application from there.
Re: add hash class extended command parameters for Button Bar
2thomasmolover
Or in a button check the box "Run minimized"
It will only be the DOS box that is minimized, not your application.
Then just use the iconic=1 parameterI just would not want to a commander windows flash beforce launch app
Or in a button check the box "Run minimized"
It will only be the DOS box that is minimized, not your application.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: add hash class extended command parameters for Button Bar
There are environment variables that are special to/in CMD: %RANDOM%, %CD%, %DATE%, %TIME%, %ERRORLEVEL% and some others (see SET /? in a CMD window). They're resolved by CMD at execution time. This means that TC won't be able to resolve any of them. Hence, the command must be executed via CMD in some way, like petermad showed in the second and third variant.
Regards
Dalai
Regards
Dalai
#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
- thomasmolover
- Member
- Posts: 177
- Joined: 2016-12-12, 01:32 UTC
Re: add hash class extended command parameters for Button Bar
Thank you. I just think that the TC could support a direct parameterStefan2 wrote: 2020-04-21, 09:53 UTC 2thomasmolover
It's then the duty of the target application to resolve them.ghisler(Author) wrote: 2020-04-19, 08:14 UTC If you put environment variables in double % signs in the parameters field,
they will NOT be resolved by Total Commander.
They will be passed with single % signs to the target application.
It's then the duty of the target application to resolve them.
Use an leading ? question sign in the Parameters box to see what TC will pass to AHK.
COMMAND: xxxxx\AHK\AutoHotkey.exe xxxx\ShowParameters.ahk
PARAMETERS: ?%%TEMP%% ### %%RANDOM%%
>>>?-DIALOG Shows: %TEMP% ### %RANDOM%
>>>OUTPUT: nothing (probably %...% are variables in AHK, and that non-existing vars in the script result in empty string)
Also passing %var% to an VBS script for example
For i = 0 to WScript.Arguments.Count -1
MsgBox WScript.Arguments.Item(i)
will not automatically expand the vars, because VBS doesn't know what you want from it.
You can pass %var%s and then handle (expand) them inside the script by using VBS functions to do that.
With CMD it will work:
COMMAND: cmd /k
PARAMETERS: ?Echo %%TEMP%% # # # %%RANDOM%%
>>>?-DIALOG Shows: Echo %TEMP% # # # %RANDOM%
>>>OUTPUT: C:\Users\Stefan2Einer\AppData\Local\Temp # # # 20050
So your program can not handle environment variables (at least not that way).
Solution: Just call a ahk script from your button, use there the EnvVars you want (or utilize AHK functions) and call your application from there.

If I use ahk or other script for the function, there are many ways to do what I want.
Thank you. I just want a perfect method without any other app include CMDpetermad wrote: 2020-04-21, 13:31 UTC 2thomasmoloverThen just use the iconic=1 parameterI just would not want to a commander windows flash beforce launch app
Or in a button check the box "Run minimized"
It will only be the DOS box that is minimized, not your application.

Thank you. that I can only use the script for it.Dalai wrote: 2020-04-21, 15:11 UTC There are environment variables that are special to/in CMD: %RANDOM%, %CD%, %DATE%, %TIME%, %ERRORLEVEL% and some others (see SET /? in a CMD window). They're resolved by CMD at execution time. This means that TC won't be able to resolve any of them. Hence, the command must be executed via CMD in some way, like petermad showed in the second and third variant.
Regards
Dalai
Re: add hash class extended command parameters for Button Bar
Ahh, I see, after all we are in the suggestions forum, ok, fine I got it nowthomasmolover wrote: 2020-04-22, 10:50 UTC ...
Thank you. I just think that the TC could support a direct parameter.
