Skip to content

Instantly share code, notes, and snippets.

@shalithasuranga
Last active March 29, 2022 01:00
Show Gist options
  • Save shalithasuranga/6b0a3b9b5b1b7bb992fcd003e2db0e95 to your computer and use it in GitHub Desktop.
Save shalithasuranga/6b0a3b9b5b1b7bb992fcd003e2db0e95 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