Solved

How to launch a desktop .lnk file from within VB?

Posted on 2001-07-12
2
206 Views
Last Modified: 2008-03-17
Show me how to launch an app, using it's desktop icon from within my VB app.
Shell doesn't seem to work.
There are parameters and switches used in the command line for the shortcut.
0
Comment
Question by:a6106a
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 50 total points
ID: 6278391
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal

lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,


ByVal nShowCmd As Long) As Long

Const SW_NORMAL = 1

sLNK = "C:\WINDOWS\DESKTOP\Whatever.lnk"

ShellExecute hwnd, "open", sURL, vbNullString, vbNullString, SW_NORMAL
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6278393
Sorry..

Need to change this line

ShellExecute hwnd, "open", sLNK, vbNullString, vbNullString, SW_NORMAL

Cheers  :)
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month6 days, 5 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question