Skip to content

Instantly share code, notes, and snippets.

@pranlawate
Forked from shalithasuranga/Win_InputBox.bat
Created January 26, 2021 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranlawate/8d8b5f5e23e2081941701bcaace6c7e3 to your computer and use it in GitHub Desktop.
Save pranlawate/8d8b5f5e23e2081941701bcaace6c7e3 to your computer and use it in GitHub Desktop.
@echo off
powershell -Command "& {Add-Type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::InputBox('Enter your name:', 'Input box example')}" > %TEMP%\out.tmp
set /p OUT=<%TEMP%\out.tmp
set msgBoxArgs="& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('You have entered: %OUT%', 'Hello');}"
powershell -Command %msgBoxArgs%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment