Programmatically open Run window

  • Thread starter Thread starter David Trimboli
  • Start date Start date
D

David Trimboli

This is just a silly question. Someone asked me if there is a way to
open the Run window from the command line.

Yes, we know about Windows + R, and yes, we can drag the Run command
onto the desktop to create a shortcut, but does anybody know if the
Run window can be called from the command line? (And I already told
them they could call the shortcut from the command line, but that's
cheating.)

I'm thinking it's some rundll32.exe call, but I could just be
imagining that.

David
Stardate 6179.0
 
David Trimboli said:
This is just a silly question. Someone asked me if there is a way to
open the Run window from the command line.

Yes, we know about Windows + R, and yes, we can drag the Run command
onto the desktop to create a shortcut, but does anybody know if the
Run window can be called from the command line? (And I already told
them they could call the shortcut from the command line, but that's
cheating.)

I'm thinking it's some rundll32.exe call, but I could just be
imagining that.

Look here: http://www.jsifaq.com/SUBT/tip9500/rh9575.htm

Willem
 
Save the following five lines as FileRun.vbs.

Dim objShell
set objShell = CreateObject("Shell.Application")
objShell.FileRun

set objShell = nothing


Save FileRun.vbs in %windir% or in some other folder that's in the PATH.
Open a command prompt and type:

filerun

Hit Enter.

Or drag FileRun.vbs into a command prompt and hit Enter.

FileRun Method
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/objects/shell/filerun.asp

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
This is just a silly question. Someone asked me if there is a way to
open the Run window from the command line.

Yes, we know about Windows + R, and yes, we can drag the Run command
onto the desktop to create a shortcut, but does anybody know if the
Run window can be called from the command line? (And I already told
them they could call the shortcut from the command line, but that's
cheating.)

What's wrong with
START "" fu.bar
?
I'm thinking it's some rundll32.exe call, but I could just be
imagining that.

Try:
RunDll32.exe shell32.dll,ShellExec_RunDLL fu.bar
 
My post disappeared. I hate that.

Open the Run command from a command prompt.

Save the following five lines as FileRun.vbs.

Dim objShell
set objShell = CreateObject("Shell.Application")
objShell.FileRun

set objShell = nothing


Save FileRun.vbs in %windir% or in some other folder that's in the PATH.
Open a command prompt and type:

filerun

Hit Enter.

Or drag FileRun.vbs into a command prompt and hit Enter.

FileRun Method
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/objects/shell/filerun.asp


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Michael Bednarek said:
What's wrong with
START "" fu.bar
?

Nothing is wrong with it; I just wondered if the original idea was
possible.

David
Stardate 6187.2
 
Wesley Vogel said:
Dim objShell
set objShell = CreateObject("Shell.Application")
objShell.FileRun
set objShell = nothing

Yes, this is what Willem suggested. In fact, I gave the people who
originally asked me this the following answer (a single line):

echo CreateObject(“Shell.Application”).FileRun >startrun.vbs & cscript
startrun.vbs & del startrun.vbs

David
Stardate 6187.2
 
Why delete startrun.vbs?

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
The FileRun.vbs and fileRUN.js that I created open the Run command with
or without using cmd.exe.

It took me too long to get the first one to work, so there's no way in hell
I am going to delete either one of them. ;-)

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Back
Top