Last active
June 18, 2022 16:12
Windows show "Run" dialog and populate the command with custom content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment