[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

7/3/2012 5:36:00 PM

I am trying to launch apps by draggin a desktop Icon to my VB6 app.
I can handle the case where I get the .LNK or .EXE or .COM
From the .LNK I can get the .EXE or .COM.

However in some cases I drag an icon from the desktop and wind up with
a path such as:

C:\Documents and Settings\Administrator\Application
Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe

In this case the name of the true app is IconEdit.exe (an Icon Editor
I really like. Plug!)

Properties of the desktop icon shows nothing useful.

If I double-click the desktop link it does open the app properly so
Windows translates.

How do I get to the real path to launch the app.


34 Answers

mm

7/3/2012 6:59:00 PM

0


"BeeJ" <nospam@spamnot.com> escribió en el mensaje
news:jsvai6$rcb$1@dont-email.me...
>I am trying to launch apps by draggin a desktop Icon to my VB6 app.
> I can handle the case where I get the .LNK or .EXE or .COM
> From the .LNK I can get the .EXE or .COM.
>
> However in some cases I drag an icon from the desktop and wind up with a
> path such as:
>
> C:\Documents and Settings\Administrator\Application
> Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe
>
> In this case the name of the true app is IconEdit.exe (an Icon Editor I
> really like. Plug!)
>
> Properties of the desktop icon shows nothing useful.
>
> If I double-click the desktop link it does open the app properly so
> Windows translates.
>
> How do I get to the real path to launch the app.

If the exe is launching another exe, you cannot know that unless you run the
first exe.


BeeJ

7/3/2012 10:13:00 PM

0

Eduardo has brought this to us :
> "BeeJ" <nospam@spamnot.com> escribió en el mensaje
> news:jsvai6$rcb$1@dont-email.me...
>>I am trying to launch apps by draggin a desktop Icon to my VB6 app.
>> I can handle the case where I get the .LNK or .EXE or .COM
>> From the .LNK I can get the .EXE or .COM.
>>
>> However in some cases I drag an icon from the desktop and wind up with a
>> path such as:
>>
>> C:\Documents and Settings\Administrator\Application
>> Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe
>>
>> In this case the name of the true app is IconEdit.exe (an Icon Editor I
>> really like. Plug!)
>>
>> Properties of the desktop icon shows nothing useful.
>>
>> If I double-click the desktop link it does open the app properly so Windows
>> translates.
>>
>> How do I get to the real path to launch the app.
>
> If the exe is launching another exe, you cannot know that unless you run the
> first exe.

Does not seem to be the case. When I run the given Path\EXE with a
ShellTo command, used to open all other .EXEs, a command window opens
but the app does not. If I double-click the same from windows desktop
the desired app opens (not a command window). Somehow Windows seems to
translate the given to the desired. And again , the sortcut properties
gives no usefull info from WE Properties.
I get the Path\EXE by programmatically deconstruction the .LNK.
That process always works when the .LNK is a different "style".
The shortcuts that seem to be a problem are those that an installer has
placed on the desktop to be used to install the app initially but once
installed the same shortcut acts to open the app.
If I right click an EXE in WE and choose create shortcut, I always get
an agreeable shortcut that yields the Path\EXE as well as ShellTo
either the LNK or the contained Path\EXE.

--
Present and unaccounted for.


Norm

7/3/2012 11:14:00 PM

0

BeeJ used his keyboard to write :
> Eduardo has brought this to us :
>> "BeeJ" <nospam@spamnot.com> escribió en el mensaje
>> news:jsvai6$rcb$1@dont-email.me...
>>>I am trying to launch apps by draggin a desktop Icon to my VB6 app.
>>> I can handle the case where I get the .LNK or .EXE or .COM
>>> From the .LNK I can get the .EXE or .COM.
>>>
>>> However in some cases I drag an icon from the desktop and wind up with a
>>> path such as:
>>>
>>> C:\Documents and Settings\Administrator\Application
>>> Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe
>>>
>>> In this case the name of the true app is IconEdit.exe (an Icon Editor I
>>> really like. Plug!)
>>>
>>> Properties of the desktop icon shows nothing useful.
>>>
>>> If I double-click the desktop link it does open the app properly so
>>> Windows translates.
>>>
>>> How do I get to the real path to launch the app.
>>
>> If the exe is launching another exe, you cannot know that unless you run
>> the first exe.
>
> Does not seem to be the case. When I run the given Path\EXE with a ShellTo
> command, used to open all other .EXEs, a command window opens but the app
> does not. If I double-click the same from windows desktop the desired app
> opens (not a command window). Somehow Windows seems to translate the given
> to the desired. And again , the sortcut properties gives no usefull info
> from WE Properties.
> I get the Path\EXE by programmatically deconstruction the .LNK.
> That process always works when the .LNK is a different "style".
> The shortcuts that seem to be a problem are those that an installer has
> placed on the desktop to be used to install the app initially but once
> installed the same shortcut acts to open the app.
> If I right click an EXE in WE and choose create shortcut, I always get an
> agreeable shortcut that yields the Path\EXE as well as ShellTo either the LNK
> or the contained Path\EXE.

BeeJ,
Is there a way you can use ShellExecute with the "Open" statement
instead of Shell? That should open it with the path as given.

Norm


BeeJ

7/4/2012 1:02:00 AM

0

Norm Fowler used his keyboard to write :
> BeeJ used his keyboard to write :
>> Eduardo has brought this to us :
>>> "BeeJ" <nospam@spamnot.com> escribió en el mensaje
>>> news:jsvai6$rcb$1@dont-email.me...
>>>>I am trying to launch apps by draggin a desktop Icon to my VB6 app.
>>>> I can handle the case where I get the .LNK or .EXE or .COM
>>>> From the .LNK I can get the .EXE or .COM.
>>>>
>>>> However in some cases I drag an icon from the desktop and wind up with a
>>>> path such as:
>>>>
>>>> C:\Documents and Settings\Administrator\Application
>>>> Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe
>>>>
>>>> In this case the name of the true app is IconEdit.exe (an Icon Editor I
>>>> really like. Plug!)
>>>>
>>>> Properties of the desktop icon shows nothing useful.
>>>>
>>>> If I double-click the desktop link it does open the app properly so
>>>> Windows translates.
>>>>
>>>> How do I get to the real path to launch the app.
>>>
>>> If the exe is launching another exe, you cannot know that unless you run
>>> the first exe.
>>
>> Does not seem to be the case. When I run the given Path\EXE with a ShellTo
>> command, used to open all other .EXEs, a command window opens but the app
>> does not. If I double-click the same from windows desktop the desired app
>> opens (not a command window). Somehow Windows seems to translate the given
>> to the desired. And again , the sortcut properties gives no usefull info
>> from WE Properties.
>> I get the Path\EXE by programmatically deconstruction the .LNK.
>> That process always works when the .LNK is a different "style".
>> The shortcuts that seem to be a problem are those that an installer has
>> placed on the desktop to be used to install the app initially but once
>> installed the same shortcut acts to open the app.
>> If I right click an EXE in WE and choose create shortcut, I always get an
>> agreeable shortcut that yields the Path\EXE as well as ShellTo either the
>> LNK or the contained Path\EXE.
>
> BeeJ,
> Is there a way you can use ShellExecute with the "Open" statement instead of
> Shell? That should open it with the path as given.
>
> Norm

I recoded to the following but unfortunately I get the same bad results
as using Shell. A command window opens, not the app.

Dim hDC As Long
hDC = GetDesktopWindow()

vRtn = ShellExecute(hDC, "Open", sDPName, sArgs, csEmptyString,
lVBAppWinStyle)

--
Present and unaccounted for.


Dee Earley

7/4/2012 8:08:00 AM

0

On 04/07/2012 02:02, BeeJ wrote:
> Norm Fowler used his keyboard to write :
>> BeeJ,
>> Is there a way you can use ShellExecute with the "Open" statement
>> instead of Shell? That should open it with the path as given.
>>
>> Norm
>
> I recoded to the following but unfortunately I get the same bad results
> as using Shell. A command window opens, not the app.
>
> Dim hDC As Long
> hDC = GetDesktopWindow()
>
> vRtn = ShellExecute(hDC, "Open", sDPName, sArgs, csEmptyString,
> lVBAppWinStyle)

Have you tried ShellExecuting the shortcut directly rather then trying
to (incorrectly) parsing the lnk file?

--
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)


BeeJ

7/4/2012 8:20:00 PM

0

Deanna Earley has brought this to us :
> On 04/07/2012 02:02, BeeJ wrote:
>> Norm Fowler used his keyboard to write :
>>> BeeJ,
>>> Is there a way you can use ShellExecute with the "Open" statement
>>> instead of Shell? That should open it with the path as given.
>>>
>>> Norm
>>
>> I recoded to the following but unfortunately I get the same bad results
>> as using Shell. A command window opens, not the app.
>>
>> Dim hDC As Long
>> hDC = GetDesktopWindow()
>>
>> vRtn = ShellExecute(hDC, "Open", sDPName, sArgs, csEmptyString,
>> lVBAppWinStyle)
>
> Have you tried ShellExecuting the shortcut directly rather then trying to
> (incorrectly) parsing the lnk file?

Yes. ?Incorrectly? parsing?
I use Windows to parse the .LNK and in all cases it gives me a proper
path except in the few cases where it returns the path previously
posted.
Somehow Windows must use the {xxx} to translate to the "proper" path
from the registry to start the app. Do you know how to extract that?

--
Present and unaccounted for.


Norm

7/4/2012 10:31:00 PM

0

BeeJ wrote :
> Deanna Earley has brought this to us :
>> On 04/07/2012 02:02, BeeJ wrote:
>>> Norm Fowler used his keyboard to write :
>>>> BeeJ,
>>>> Is there a way you can use ShellExecute with the "Open" statement
>>>> instead of Shell? That should open it with the path as given.
>>>>
>>>> Norm
>>>
>>> I recoded to the following but unfortunately I get the same bad results
>>> as using Shell. A command window opens, not the app.
>>>
>>> Dim hDC As Long
>>> hDC = GetDesktopWindow()
>>>
>>> vRtn = ShellExecute(hDC, "Open", sDPName, sArgs, csEmptyString,
>>> lVBAppWinStyle)
>>
>> Have you tried ShellExecuting the shortcut directly rather then trying to
>> (incorrectly) parsing the lnk file?
>
> Yes. ?Incorrectly? parsing?
> I use Windows to parse the .LNK and in all cases it gives me a proper path
> except in the few cases where it returns the path previously posted.
> Somehow Windows must use the {xxx} to translate to the "proper" path from the
> registry to start the app. Do you know how to extract that?

As Deanna said try using ShellExecute with the path to the .lnk without
parsing. I have run into this before and it does seem to be a problem
with parsing the path and I never did find out why.

Norm


Henning

7/4/2012 11:13:00 PM

0


"BeeJ" <nospam@spamnot.com> skrev i meddelandet
news:jsvai6$rcb$1@dont-email.me...
>I am trying to launch apps by draggin a desktop Icon to my VB6 app.
> I can handle the case where I get the .LNK or .EXE or .COM
> From the .LNK I can get the .EXE or .COM.
>
> However in some cases I drag an icon from the desktop and wind up with a
> path such as:
>
> C:\Documents and Settings\Administrator\Application
> Data\Microsoft\Installer\{06F64222-5A0C-4184-B2F1-2097763DCCAD}\_3e6859d8.exe
>
> In this case the name of the true app is IconEdit.exe (an Icon Editor I
> really like. Plug!)
>
> Properties of the desktop icon shows nothing useful.
>
> If I double-click the desktop link it does open the app properly so
> Windows translates.
>
> How do I get to the real path to launch the app.
>
>
Have you searched the registry for the ?key?
06F64222-5A0C-4184-B2F1-2097763DCCAD?

/Henning



Mayayana

7/4/2012 11:34:00 PM

0

| Yes. ?Incorrectly? parsing?
| I use Windows to parse the .LNK and in all cases it gives me a proper
| path except in the few cases where it returns the path previously
| posted.
| Somehow Windows must use the {xxx} to translate to the "proper" path
| from the registry to start the app. Do you know how to extract that?
|

Doesn't it make sense to just shell the link?

If you don't want to do that... I think you're dealing
with a Windows Installer shortcut. Microsoft has become
increasingly GUID-crazed. They stick GUIDs on "anything
that isn't nailed down" these days. I came across this code
that you can try. (I can't test it as I don't have any such
lnks.)

Set WI = CreateObject("WindowsInstaller.Installer")
Set MSILnk = WI.ShortcutTarget(lnkpath)
MsgBox WI.ComponentPath(MSILnk.StringData(1), MSILnk.StringData(3))

It's explained here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa369480%28v=vs....

However, I have two versions of WI help. The latest is v. 4.5.
Neither one has any mention of either of the two WI properties
involved. I'd guess that the GUID can probably be matched in the
Registry, but I don't know where.


BeeJ

7/5/2012 12:19:00 AM

0

After serious thinking Norm Fowler wrote :
> BeeJ wrote :
>> Deanna Earley has brought this to us :
>>> On 04/07/2012 02:02, BeeJ wrote:
>>>> Norm Fowler used his keyboard to write :
>>>>> BeeJ,
>>>>> Is there a way you can use ShellExecute with the "Open" statement
>>>>> instead of Shell? That should open it with the path as given.
>>>>>
>>>>> Norm
>>>>
>>>> I recoded to the following but unfortunately I get the same bad results
>>>> as using Shell. A command window opens, not the app.
>>>>
>>>> Dim hDC As Long
>>>> hDC = GetDesktopWindow()
>>>>
>>>> vRtn = ShellExecute(hDC, "Open", sDPName, sArgs, csEmptyString,
>>>> lVBAppWinStyle)
>>>
>>> Have you tried ShellExecuting the shortcut directly rather then trying to
>>> (incorrectly) parsing the lnk file?
>>
>> Yes. ?Incorrectly? parsing?
>> I use Windows to parse the .LNK and in all cases it gives me a proper path
>> except in the few cases where it returns the path previously posted.
>> Somehow Windows must use the {xxx} to translate to the "proper" path from
>> the registry to start the app. Do you know how to extract that?
>
> As Deanna said try using ShellExecute with the path to the .lnk without
> parsing. I have run into this before and it does seem to be a problem with
> parsing the path and I never did find out why.
>
> Norm

I did that and it did not work.

--
Present and unaccounted for.