Skip to content

Instantly share code, notes, and snippets.

@pranlawate
Forked from shalithasuranga/Win_CustomWindow.bat
Created January 26, 2021 16:07
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/18d0678f621f331553d26ea40711c51d to your computer and use it in GitHub Desktop.
Save pranlawate/18d0678f621f331553d26ea40711c51d to your computer and use it in GitHub Desktop.
@echo off
powershell -Command "& {Add-Type -AssemblyName System.Windows.Forms; $mainForm = New-Object System.Windows.Forms.Form; $mainForm.Text = 'Main Window'; $lbl = New-Object System.Windows.Forms.Label; $lbl.Text = 'Hello World'; $mainForm.Controls.Add($lbl); $mainForm.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen; $mainForm.ShowDialog()}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment