How to send a string to the Run Dialog?

letdown427

Golden Member
Jan 3, 2006
1,594
1
0
Haven't been programming that long, so sorry if I have missed something obvious. I want to send a string to the run dialog, so it's effectively like having the user type in the string into it and pressing enter.

Thanks very much,

James
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Wouldn't be easy to do, I'm guessing, unless Explorer supports an automation interface that provides explicit access.
 

Apathetic

Platinum Member
Dec 23, 2002
2,587
6
81
Do you want to pass something to the actual box a user sees when they click on "Start", "Run"... or do you just want to start another application from within yours?

Dave
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Actually, I'm rethinking this now, because Explorer keeps the last run command somewhere, likely in the registry. Modify that and you modify the command that the user will see next time they open the run dialog. Not sure why you would want to do this, as the previous poster alludes there are easier ways to spawn a process.
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
Why would you want to do this? Either implement your own Run dialog, not hard to do, just two button and a textbox, or just start the process you want to start. Like at the VB6 Shell Function or ShellExecute Win32API call.