shellexecuteex works on some xp boxes but not others

shellexecuteex works on some xp boxes but not others

Post by jay.olear » Sat, 26 Aug 2006 00:57:22


I'm launching a document in the form: file://///server/share/file.ext
using shellexecuteex. This works on some xp boxes but not others.
Could there be some security setting that is preventing this? The
same unc format works fine from the browser or the start..run menu
item.

Here is the code:

SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.lpFile = szUrl;
sei.nShow = SW_SHOW;
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.lpVerb = "open";
sei.hProcess = NULL;
sei.hwnd = NULL;


if (!ShellExecuteEx(&sei))
 
 
 

shellexecuteex works on some xp boxes but not others

Post by Paul Baker » Sat, 26 Aug 2006 01:48:05

You should probably use backslashes ( \ ) though.

Is an error message being shown? What is the message?

Paul

"WinAbility.Com"
< XXXX@XXXXX.COM > wrote in

 
 
 

shellexecuteex works on some xp boxes but not others

Post by jay.olear » Sat, 26 Aug 2006 01:53:48

True...\\server\share\file.ext works just fine --- although file:///
works with url encoded paths and \\server\share... doesn't seem to.

At this point it's just more of a curiosity...as far as I know, one
form is not more correct than the other....
 
 
 

shellexecuteex works on some xp boxes but not others

Post by jay.olear » Sat, 26 Aug 2006 01:58:15

Shellexecuteex returns true so there is no error.
 
 
 

shellexecuteex works on some xp boxes but not others

Post by WinAbility » Sat, 26 Aug 2006 02:09:14

"Paul Baker [MVP, Windows - Networking]" < XXXX@XXXXX.COM >


Duh... That's what happens when you copy and paste mindlessly :-)

--
Regards,

Andrei Belogortseff
WinAbility(r) Software Corp. [ http://www.yqcomputer.com/ ]
"Useful Windows Utilities and Security Software"
 
 
 

shellexecuteex works on some xp boxes but not others

Post by WinAbility » Sat, 26 Aug 2006 02:13:52


It may or may not be so. We've been using the second form (without the file:
prefix) in our products for years and have never had a problem with
ShellExcecuteEx. We've never used the file: prefix, so I can't really say
anything about it. But it's easy to test: if you remove the prefix and it
runs fine after that on the machine where it previously did not run, that's
the culprit! Please let us know the result so that we all could learn
something new today :-)

--
Regards,

Andrei Belogortseff
WinAbility(r) Software Corp. [ http://www.yqcomputer.com/ ]
"Useful Windows Utilities and Security Software"
 
 
 

shellexecuteex works on some xp boxes but not others

Post by Paul Baker » Sat, 26 Aug 2006 02:47:12

I did not ask if there was an error returned. I asked if there was an error
message being shown (to the user).

Paul
 
 
 

shellexecuteex works on some xp boxes but not others

Post by Paul Baker » Sat, 26 Aug 2006 02:49:37

Here's something to try.

Compare the HKCR\file registry entries, and the registry entries and files
it references, on the machine that works versus a machine that does not.

Try using the same file: URL in the Start/Run dialog. If you see similar
behaviour, you can eliminate your code as the real cause.

Paul

"WinAbility.Com"
< XXXX@XXXXX.COM > wrote in
 
 
 

shellexecuteex works on some xp boxes but not others

Post by jay.olear » Sat, 26 Aug 2006 04:02:38

ooops...my bad....no, there is no error displayed to the user.