( Echo the lines below are commented Rem/||( some comment text that will work within brackets. The REM command always evaluates to TRUE so these lines will never be executed. ) )
@Goto %:^)
*** This text is your message to editor in your code ***
%:^)
@echo off && mode 50,4 && title <nul && set "_yn=" <nul
setlocal & color 0A & title .\%~nx0 & >"%temp%\_vbs.vbs" ^
set /p "'=yn=msgbox("Hey!, Close %~nx0 Now!",4,"Warnning!!."):wsh.echo yn" <nul
%__AppDir__%cscript.exe "%temp%\_vbs.vbs" //nologo | find "6" >nul && set "_yn=y"
if "%_yn%"=="y" (endlocal && echo\Thank you, %~nx0 stopped by user!.. && goto :EOF)
set "_yn=" & rem :: if user answer is "No" do more below here ::
for %%i in ( "OK button only. 0.Simple Ok",
"OK and Cancel buttons. 1.Simple OK or Cancel",
"Abort Retry Ignore buttons. 2.Simple Abort Retry or Ignore",
"Yes No and Cancel buttons. 3.Yes No Cancel",
"Yes No buttons. 4.Yes or No",
"Retry Cancel buttons. 5.Retry Cancel",
"Critical Message icon. 16.Critical Error Retry Cancel",
"Warning Query icon. 32.Warnning and Simple Ok",
"Warning Message icon. 48.Warnning ans Simple Ok",
"Information Message icon. 64.Warnning and Simple Ok",
)do call %:^] "%%~i"
%:^]
if "%~1" == "" %__AppDir__%timeout.exe -1 | <nul ^
echo\Press any key any time... & endlocal & goto :EOF
for /f tokens^=1-3delims^=. %%i in ('echo\%~1
')do echo\msgbox"%%~i",%%~j,"%%~k" >"%temp%\_vbs.vbs"
%__AppDir__%wscript.exe "%temp%\_vbs.vbs" //nologo & exit /b
您可以在您的 bat 文件中使用 VBS 并要求您的用户关闭或不...
:: Create you VBS dialog box file:
echo\Msgbox"You text msg", int_id,"Window Title" >"%temp%\_vbs.vbs"
run your VBS file:
%__AppDir__%cscript.exe "%temp%\_vbs.vbs" //nologo
让用户点击cmd中的变量:
:: set user answer click ::
=yn=msgbox("Hey!, Close %~nx0 Now!",4,"Warnning!!."):wsh.echo yn"
:: set user answer click value/id Yes and No ::
Yes == 6
No == 7
:: Command line run VBS |redirect output | find "answer_Number" ::
%__AppDir__%cscript.exe "%temp%\_vbs.vbs" //nologo |find "6"
:: With operator && and set if find "6" ::
%__AppDir__%cscript.exe "%temp%\_vbs.vbs" //nologo |find "6" >nul && set "_yn=y"
:: VBS ID click returns:
Ok = 1
Cancel = 2
Abort = 3
Retry = 4
Ignore = 5
Yes = 6
No = 7
一种方法是添加一堆
REM
行并包含echo on
. 然后,您可以像这样放置横幅消息:有关更多信息,请参阅此处
REM
如果这不能如您所愿,请查看https://ss64.com/nt/rem.html上的示例
@Echo OFF Goto :START Description can go here which can even include - | > characters
:START
( Echo the lines below are commented Rem/||( some comment text that will work within brackets. The REM command always evaluates to TRUE so these lines will never be executed. ) )
您可以在您的 bat 文件中使用 VBS 并要求您的用户关闭或不...