AskParam: Asks for command-line parameters via GUI dialog

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *dindog »

MVV wrote: 2019-12-12, 05:32 UTC Well, it is really a problem of all such systems - how to detect end of a token if two tokens are concatenated.
In this case it is not easy to detect how many digits are in parameter number if there are digits just after parameter number, this is not a bug but an ambiguity. Program can't know what do you want to insert - %1 and 2019, %12 and 019 etc (imagine a case when there are enough parameters passed).

For such cases there is a 3-digit limitation in AskParam for parameter number (i.e. you can't ask for more than 999 parameters :)).
So you can try %%001%N in your button parameters, and this will always mean that you want to insert %001 and then any following digits:

Code: Select all

Parameters: /q"`" /rd /c"param" /u"A: `%P`" /p(h)"Profile:" cmd /c echo %%001%N && pause
Also you can insert parameter via %AskParam1%, so there will be no ambiguity:

Code: Select all

Parameters: /q"`" /rd /c"param" /u"A: `%P`" /p(h)"Profile:" cmd /c echo %%AskParam1%%%N && pause
Thanks. problem solved.
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

2MVV
Hello, is there have new version of askparam?

I seemly see there is a new beta that can set the icon on wincmd.ru forum

But now i can't connect totalcmd.net and wincmd.ru for check.

Anyway, thanks for your reading.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *MVV »

Sorry, there were no new versions last three years, the most recent was 1.0.7.160:

AskParam beta 160 (changes since build 146):
+ /i option allows changing icon on the fly
* some buffer security checks added
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

Thanks for the link, it's better now with the new /i option :)

https://i.imgur.com/Vx9Dw5v.jpg
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

Sorry for one question, how can i use the p(e) option?

I try this command

Code: Select all

AskParam.exe /p(e)"url: Enter password:" cmd /k youtube-dl.exe %%url%%
But when i type 123, i still get tye result youtube-dl url not youtube-dl 123

What's wrong with my command? Thank you.

Askparam's ver is 1.0.7.160
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *MVV »

With your example and 123, I see properly started process in task manager:

Code: Select all

"C:\Windows\System32\cmd.exe" /k youtube-dl.exe 123
Try these two:

Code: Select all

AskParam.exe /p(e)"url: Enter password:" cmd /k set url
AskParam.exe /p(e)"url: Enter password:" cmd /k echo youtube-dl.exe %%url%%
If you see your typed text, AskParam works fine. If your text contains spaces, perhaps you should quote %%url%%.
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

Thanks for your reply

If i use the second cmd which has two lines
I will see two times of the askparam's window which ask for the password.
Is it right?

BTW.It's ok with

Code: Select all

AskParam.exe /p"Enter password:" cmd /k youtube-dl.exe %%1
but it's not ok with

Code: Select all

AskParam.exe /p"Enter password:" cmd /k youtube-dl.exe %%AskParam1%%
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *Usher »

MVV wrote: 2020-05-15, 10:22 UTC If you see your typed text, AskParam works fine. If your text contains spaces, perhaps you should quote %%url%%.
Spaces in URL should be percent-encoded as %20
Andrzej P. Wozniak
Polish subforum moderator
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *MVV »

Usher,
You're right, it is not required for URLs, but as a general rule would be useful to always quote all user-defined arguments.

kesdoputr,
There are two sample command lines in my code block, and each of them should show dialog once.

Your command line with %%AskParam1%% also works for me. When I type 123, I see following process command line:

Code: Select all

"C:\Windows\System32\cmd.exe" /k youtube-dl.exe 123
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

2MVV
It's strange, i make a bat file and it's content below

Code: Select all

AskParam.exe /p"Enter password:" cmd /k youtube-dl.exe %%AskParam1%%
And i put the bat file together with askparam.exe

Then i run the bat and type 123
https://i.imgur.com/1MuPk33.png
But when i press ok i get this result
https://i.imgur.com/8hFtI0E.png

Will the reason be the OS? I am using Windows7 SP1 x64
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *nsp »

kesdoputr wrote: 2020-05-15, 19:53 UTC 2MVV
It's strange, i make a bat file and it's content below

Code: Select all

AskParam.exe /p"Enter password:" cmd /k youtube-dl.exe %%AskParam1%%
If you use inside a bat/cmd file, you have to double % sign.

Code: Select all

@REM youtuble-dl bat file
AskParam.exe /p"Enter password:" cmd /k youtube-dl.exe %%%%AskParam1%%%%
From command line or button bar, you do not have to double %.
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *kesdoputr »

2nsp
It's work with double %% sign.
And it's also work when use p(e) option like %%%%url%%%%

Thanks for your reply.
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *funkymonk »

Hi there,

I still use AskParam extensively. It's very convenient for many tasks.

Is there a command line parameter to show the final command line (in an editable textbox) right before executing it? Maybe it can be added?
This would be great for debugging the parameters and for changing minor details before execution.

Thank you!
lcf
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *Stefan2 »

funkymonk wrote: 2023-02-15, 13:45 UTC Hi there,

I still use AskParam extensively. It's very convenient for many tasks.

Is there a command line parameter to show the final command line (in an editable textbox) right before executing it? Maybe it can be added?
This would be great for debugging the parameters and for changing minor details before execution.

Thank you!
lcf


In TCs' Parameterbox you can add a leading ? -sign to be prompted.





 
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: AskParam: Asks for command-line parameters via GUI dialog

Post by *funkymonk »

Stefan2 wrote: 2023-02-15, 13:51 UTC In TCs' Parameterbox you can add a leading ? -sign to be prompted.
Well, thank you, but that's not what I need.
I was asking about the final command line as composed by AskParam (not about the command line to call AskParam from TC).
Post Reply