Command that open window with buttons YES or NO
Moderators: white, Hacker, petermad, Stefan2
Command that open window with buttons YES or NO
Hi, I've been looking for a build-in command that will open a prompt window with two buttons YES or NO. YES will run the next command and NO will exit.
Is there such thing in TC or is there another way to do it using the mouse? Cause one way to do it is with bat file and keyboard, but I need to use the mouse.
Thanks!!
Is there such thing in TC or is there another way to do it using the mouse? Cause one way to do it is with bat file and keyboard, but I need to use the mouse.
Thanks!!
You could use Nircmd
will open a Yes/No dialog and will run the calculator when you press Yes.
Code: Select all
nircmd.exe qbox "Do you want to run the calculator ?" "Question:" "calc.exe"
Thanks!! That's a nice option too.ZoSTeR wrote:You could use Nircmd
will open a Yes/No dialog and will run the calculator when you press Yes.Code: Select all
nircmd.exe qbox "Do you want to run the calculator ?" "Question:" "calc.exe"
Anyway it would be nice to do it with TC build in commands too.
Using ? in the parameter field of a command button does this with internal TC.liamZ wrote:Thanks!! That's a nice option too.ZoSTeR wrote:You could use Nircmd
will open a Yes/No dialog and will run the calculator when you press Yes.Code: Select all
nircmd.exe qbox "Do you want to run the calculator ?" "Question:" "calc.exe"
Anyway it would be nice to do it with TC build in commands too.
Enter or OK button starts the command, ESC or Cancel button cancels.
So I don't see any need for any other tool or script.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
You don´t? That's a window to modify the parameters and does not give any information or warning of what the command is going to do. And the most important part of the YES/NO buttons is to know what is goping to happend if you click YES.Horst.Epp wrote:Using ? in the parameter field of a command button does this with internal TC.
Enter or OK button starts the command, ESC or Cancel button cancels.
So I don't see any need for any other tool or script.
Anyway if anyone is interested in the VBscipt method, this works fine:
Code: Select all
@echo off
call :MsgBox "WARNING INFORMATION" "VBYesNo" "QUESTION"
if errorlevel 7 (
echo NO
) else if errorlevel 6 (
echo YES
)
PAUSE
exit
:MsgBox prompt type title
setlocal enableextensions
set "tempFile=%temp%\%~nx0.%random%%random%%random%vbs.tmp"
>"%tempFile%" echo(WScript.Quit msgBox("%~1",%~2, "%~3") & cscript //nologo //e:vbscript "%tempFile%"
set "exitCode=%errorlevel%" & del "%tempFile%" >nul 2>nul
endlocal & exit /b %exitCode%
Sorry, but if I press one of my self defined buttonsliamZ wrote:You don´t? That's a window to modify the parameters and does not give any information or warning of what the command is going to do. And the most important part of the YES/NO buttons is to know what is goping to happend if you click YES.Horst.Epp wrote:Using ? in the parameter field of a command button does this with internal TC.
Enter or OK button starts the command, ESC or Cancel button cancels.
So I don't see any need for any other tool or script.
Anyway if anyone is interested in the VBscipt method, this works fine:
Code: Select all
@echo off call :MsgBox "WARNING INFORMATION" "VBYesNo" "QUESTION" if errorlevel 7 ( echo NO ) else if errorlevel 6 ( echo YES ) PAUSE exit :MsgBox prompt type title setlocal enableextensions set "tempFile=%temp%\%~nx0.%random%%random%%random%vbs.tmp" >"%tempFile%" echo(WScript.Quit msgBox("%~1",%~2, "%~3") & cscript //nologo //e:vbscript "%tempFile%" set "exitCode=%errorlevel%" & del "%tempFile%" >nul 2>nul endlocal & exit /b %exitCode%
I know what it will do
So you press buttons without knowing what they will do.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64