Batch,PowerShell,Macro/Batch(CMD)
배치에서 버튼 박스 띄우기 스크립트
rstar
2020. 2. 7. 10:45
에러레벨 7사이는 "NO"버튼 클릭
에러레벨 6 은 YES "버튼 클릭"
@echo off
call :MsgBox "Which button will you click?" "VBYesNo+VBQuestion" "Choose any button!!"
if errorlevel 7 (
echo NO button clicked
pause
) else if errorlevel 6 (
echo YES button clicked
pause
)
exit /b
: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%