Skip to content

Instantly share code, notes, and snippets.

View dadooda's full-sized avatar

Alex Fortuna dadooda

View GitHub Profile
@dadooda
dadooda / show-run-dialog.ps1
Last active June 18, 2022 16:12
Windows show "Run" dialog and populate the command with custom content
# Show the "Run" dialog.
(New-Object -ComObject "Shell.Application").FileRun()
Start-Sleep -Milliseconds 50
# Focus at the dialog.
# Doesn't seem to work, I've got no VisualBasic installed.
#[Microsoft.VisualBasic.Interaction]::AppActivate(“Run”)
# Type in the command.
[System.Windows.Forms.SendKeys]::SendWait("hehe")