On Fri, 09 Mar 2007, Chris Wagner wrote:
> 
> It doesn't work for me either.  On my system it opens printargs.pl in
> notepad. Editing is the default action under Explorer.  The shell shouldn't
> care about Explorer's settings.  Now if I change the default action to Run,
> it works as expected.  Better to use bash for these sorts of things. :)

As I wrote before, cmd.exe is using the ShellExecuteEx() function to run
files via file associations (anything but .bat, .cmd, .com, and .exe files).
The later 4 filetypes are started by a call to CreateProcess().

In the Microsoft Windows lingo "Shell" means the same as "Windows Explorer".

If you are curious, take a list of the parameter block for ShellExecuteEx():

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/shellexecuteinfo.asp

It shows you the rules for executing a file without specifying a verb:

| * For systems prior to Windows 2000, the default verb is used if it
|   is valid and available in the registry. If not, the "open" verb
|   is used.
|
| * For Windows 2000 and later systems, the default verb is used if
|   available. If not, the "open" verb is used. If neither verb is
|   available, the system uses the first verb listed in the registry.

You'll also notice that SHELLEXECUTEINFO has no mechanism to specify that
file handles should be inherited, which is the reason why STDIO redirection
on the commandline doesn't work.  The reason there is no flag for this is
that there may not even be a new process to run the file.  The filename
may just be passed via DDE to an already running instance of a program.
And any ways, the new process would be a child of the shell, and not of
the process calling ShellExecuteEx().

Cheers,
-Jan
 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to