Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a shortcut from within Foxpro
Message
From
23/04/2003 13:47:57
Len Wooden
Statistical Resources, Inc
Baton Rouge, Louisiana, United States
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00780657
Message ID:
00780716
Views:
8
>The WSH Shell object does have problems running some lnk files. You'll get an "Access Denied" error with the more complex (3 Kb) short cut links. Another way to identify them is to check the shortcut tab of the properties dialog. The target area is shown as read-only. There's no problem with the standard lnk file and the run method.
>
>If you're not getting the message above, but rather one that says that the file can't be located, then it's probably being caused by a long file name, not enclosed in quotes.
>
>One alternative workaround would be to use the WSH to get an object reference to the shortcut, and then pass the TargetPath member to the Run method. To do this you'd use the WSH's Shell object's CreateShortcut method passing the lnk file name.

Let's see if I have this correct George, I'm not getting an Access Denied msg, and the Target is not read-only.. so it rules that out.. I AM getting file can't be located and I am passing the long file name enclosed in quotes.. so in theory that shouldnt be it either.. but I will test on a short file name. As to the alternative method.. are you suggesting that using CreateShortcut will allow me to read the Target of an existing ShortCut??? -- if so.. that's the ticket!

-- Len
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform