Reputation: 6504
Everyone knows the Run window that you can open with the shortcut Windows+R or directly in the Windows menu then Run.
I'm wondering how to open this Run window programmatically.
This window seems to be part of explorer.exe.
Does anyone have an idea on it ?
Upvotes: 5
Views: 1354
Reputation: 15685
In PowerShell:
(New-Object -ComObject "Shell.Application").FileRun()
This does have the effect of flashing the PowerShell window for a moment, however
Or alternatively with
explorer "shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}"
Upvotes: 0
Reputation: 121
FYI, in Windows 10/11 (havn't checked 8.x) you can open the Run dialog easily by calling:
explorer shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
E.g. in a batch script:
start explorer shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
... and in pwsh
with quotes:
explorer "shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}"
Upvotes: 2
Reputation: 15685
Using Windows Command (cmd.exe
):
cmd /c 'explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}'
Upvotes: 0
Reputation: 557
If you mean that it could open say at 8:00 am, then you can use autohotkey and simply write
and then compile it as an .exe and put it as a cron jobSendInput {Raw}{Lwin}{R}
Upvotes: 1
Reputation: 69706
You can use IShellDispatch::FileRun
to achieve this.
See Using the Windows RunFile dialog - The documented and undocumented way for details and sample code.
Upvotes: 4