AskParam: Asks for command-line parameters via GUI dialog
Moderators: white, Hacker, petermad, Stefan2
AskParam: Asks for command-line parameters via GUI dialog
This little tool allows entering command line parameters in GUI dialog. Entered parameters may be inserted into command line of process to be started in any order and ammount. You can set dialog title, prompt text and set of suggested strings for drop-down list. Environment variables in suggested strings are expanded automatically before asking corresponding parameter value.
Environment variables are expanded anywhere: in started application path, in suggested strings, in full parameter string passed to that application, and in dialog caption and hint text.
Start AskParam w/o parameters to read message with syntax description.
How to call AskParam from batch multiple times and gather all answers?
Last version information
Version: 1.0.6
URL: AskParam at wincmd.ru / AskParam at totalcmd.net
Requirements: operating system Windows 2000 and above, Total Commander (Total Commander is not necessary)
Environment variables are expanded anywhere: in started application path, in suggested strings, in full parameter string passed to that application, and in dialog caption and hint text.
Start AskParam w/o parameters to read message with syntax description.
How to call AskParam from batch multiple times and gather all answers?
Last version information
Version: 1.0.6
URL: AskParam at wincmd.ru / AskParam at totalcmd.net
Requirements: operating system Windows 2000 and above, Total Commander (Total Commander is not necessary)
Last edited by MVV on 2019-12-12, 06:03 UTC, edited 5 times in total.
ehab wrote:MVV, can you please add a /H to the askparam parameters so it hides the text entered.
why? i use askparam to enter a password and with current state it has clear text.
thanks for any reply.
OK, I'll add input mode for entering passwords.seb- wrote:This would be a nice enhancement, support.
Added after 11 minutes:
Done, please download updated version.
I've added parameters /h and /h-, first one enables password enter mode, second one disables it. Just change the mode before corresponding /p parameter, e.g.:
Code: Select all
AskParam.exe /cTest /tmYpAsS /h /p"Enter password:" /td /h- /p"Enter drive letter:"
i have an addition to ask
i sometimes need to pass the password to a console application STDIN, exactly like ssh-askpass.
there is an old tool that does not work anymore called win-ssh-askpass found http://sourceforge.net/projects/winsshaskpass/
the important part is instead of passing the arguments and calling the exe it writes the input to STDIN
this was the code from the above project needed in AskParam :
MVV, can you please add this feature.
for example
the /R parameter would write to the STDOUT and when used only 1 Input is allowed, " askparam does not parse more than one /p
i hope i explained the idea and thanks for any consideration from your side.
i sometimes need to pass the password to a console application STDIN, exactly like ssh-askpass.
there is an old tool that does not work anymore called win-ssh-askpass found http://sourceforge.net/projects/winsshaskpass/
the important part is instead of passing the arguments and calling the exe it writes the input to STDIN
this was the code from the above project needed in AskParam :
Code: Select all
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
DWORD count;
AllocConsole();
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
WriteFile(hStdout, Pwd.c_str(), Pwd.Length(), &count, NULL);
Application->Terminate();
}
for example
Code: Select all
AskParam.exe /R /cTest /tmYpAsS /h /p"Enter password:"
i hope i explained the idea and thanks for any consideration from your side.
#181344 Personal licence
i am still trying it but seams it needs a command to execute which in my case i don't have.
can you please tell me what is wrong with this:
i use the cls because i have no command? i just want ConPaste.exe return the entered password to the caller in my case something like:
the above does not work.
Anyway, thanks for mentioning this tool, will be useful one day.
can you please tell me what is wrong with this:
Code: Select all
ConPaste.exe /c"caption" /p"pass" "enterpassword" cls
Code: Select all
encfs.exe d:\enPath t:\ -S ConPaste.exe /c"caption" /p"pass" "enterpassword" cls
Anyway, thanks for mentioning this tool, will be useful one day.
#181344 Personal licence
AFAIK there are TWO ways to pass a password to a console application:
1. Pass it in command line parameters. AskParam can already do it, especially with /h mode.
2. Write it directly to console when application is requesting for user input (when it writes something like 'Enter a password:'). In such case you may simply write password to console window or use ConPaste to ask it via GUI dialog.
I don't know other cases when you need to enter password.
1. Pass it in command line parameters. AskParam can already do it, especially with /h mode.
2. Write it directly to console when application is requesting for user input (when it writes something like 'Enter a password:'). In such case you may simply write password to console window or use ConPaste to ask it via GUI dialog.
I don't know other cases when you need to enter password.
You also have a 2b solution using redirection (if application accept it):MVV wrote:AFAIK there are TWO ways to pass a password to a console application:
1. Pass it in command line parameters. AskParam can already do it, especially with /h mode.
2. Write it directly to console when application is requesting for user input (when it writes something like 'Enter a password:'). In such case you may simply write password to console window or use ConPaste to ask it via GUI dialog.
I don't know other cases when you need to enter password.
Code: Select all
echo %password%|myApplication ...
SendPassFromGUI|myApplication
myApplication ....<FilenameWithPassword.txt
Redirection just matches case 2: when an application requests for user input, Windows passes data from a pipe to it. So ConPaste may be used here, you only need to copy password asking string.
E.g. in case of 7z.exe archiver: when it needs a password, it writes Enter password: to a console and waits for user input. So when you start it via ConPaste, it asks you for the password and passes it to archiver (other ConPaste flags are not necessary):
You can do the same for your encfs.exe, you only need to know that password input prompt string.
E.g. in case of 7z.exe archiver: when it needs a password, it writes Enter password: to a console and waits for user input. So when you start it via ConPaste, it asks you for the password and passes it to archiver (other ConPaste flags are not necessary):
Code: Select all
ConPaste.exe "Enter password" 7z.exe <parameters>
If ASkParam.exe is called from within a batch file with parameters how can I differentiate between parameters of the batch file and parameters of AskParam? Currently %1 gives the batch file parameter.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more