Last active
June 18, 2022 16:12
-
-
Save dadooda/259b625fb7ea0b617e02921f88e26914 to your computer and use it in GitHub Desktop.
Windows show "Run" dialog and populate the command with custom content
This file contains hidden or 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