Skip to content

Instantly share code, notes, and snippets.

@pranlawate
Forked from shalithasuranga/Win_messageBox2.bat
Created January 26, 2021 16:06
Show Gist options
  • Save pranlawate/6b692e6fdf8a3243efffd69b0abab06d to your computer and use it in GitHub Desktop.
Save pranlawate/6b692e6fdf8a3243efffd69b0abab06d to your computer and use it in GitHub Desktop.
@echo off
powershell -Command "& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('Hello', 'Hey', 'YesNo', [System.Windows.Forms.MessageBoxIcon]::Warning);}" > %TEMP%\out.tmp
set /p OUT=<%TEMP%\out.tmp
if %OUT%==Yes (echo Clicked Yes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment