|
-
Oct 23rd, 2003, 01:32 AM
#1
Thread Starter
PowerPoster
Get shortcut path
When my app is installed it creates a shortcut (Start-->Programs-->MyApp). As users will install the app to different locations and on different drives, how can I get the path of the shortcut so i can then place another on the desktop?
I can create a shortcut, I just need to be able to get the path of the shortcut created from the setup.
Thanks.
-
Oct 23rd, 2003, 01:39 AM
#2
Frenzied Member
hmm why not place the shortcut using the installation prog?
it should have the ability to find the desktop for u
-
Oct 23rd, 2003, 01:43 AM
#3
Thread Starter
PowerPoster
The P&D wizard only gives you the option to create one at (Start-->Programs-->MyApp) and not on the desktop.
-
Oct 23rd, 2003, 01:53 AM
#4
Frenzied Member
what a POS, i personally use the visual studio .net P&D wizard to deploy my vb6 stuff.. anyway
VB Code:
Private Sub Command1_Click()
If Environ("userprofile") <> "" Then
MsgBox Environ("userprofile") & "\desktop"
Else
MsgBox Environ("windir") & "\desktop"
End If
End Sub
-
Oct 23rd, 2003, 07:57 AM
#5
Hyperactive Member
Try this
Code:
Public Function Get_Shortcut_TargetFile_Name( _
Optional LinkFile As String) As String
' resolve a shortcut target
' needs reference to: "Windows Script Host Object Model" wshom.ocx
' Windows2000 fails at Set WS = New WshShell
' "Automation error. The specified procedure could not be found."
Dim WS As WshShell
Dim oShellLink As WshShortcut
Set WS = New WshShell
Set oShellLink = WS.CreateShortcut(LinkFile) 'all shortcuts end in .LNK
Get_Shortcut_TargetFile_Name = oShellLink.TargetPath
Set oShellLink = Nothing
Set WS = Nothing
End Function ' Get_Shortcut_TargetFile_Name
'################################################################################
"The wise man doesn't know all the answers, but he knows where to find them."
VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15
-
Oct 24th, 2003, 12:25 PM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|