Programmatically open Run window

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
 
W

Willem Kossen

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
 
W

Wesley Vogel

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
 
M

Michael Bednarek

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
 
W

Wesley Vogel

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
 
D

David Trimboli

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
 
D

David Trimboli

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
 
W

Wesley Vogel

Why delete startrun.vbs?

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
W

Wesley Vogel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top