Solved

How to create shortcut a program using vb.net???

Posted on 2011-03-14
10
859 Views
Last Modified: 2012-05-11
hi guys

i must create a shortcut of this link
"g:\program files\ltcr\mgx.exe" /nomutex

Open in new window

using vb.net

help me for this solution

thank you.
0
Comment
Question by:l0o3
[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
  • 5
  • 4
10 Comments
 
LVL 41

Expert Comment

by:graye
ID: 35132520
The easiest way is to use the Windows Shell...  This should get you started in the right direction...

Shell = New IWshRuntimeLibrary.IWshShell_Class
Shortcut = Shell.CreateShortcut(file)
0
 

Author Comment

by:l0o3
ID: 35132643
i dident IWshRuntimeLibrary.IWshShell_Class class

where is this?
0
 
LVL 41

Expert Comment

by:graye
ID: 35133819
My appologies, I was running out the door when I wrote that response.

You need to "add a reference" to your project....  Specifically a "COM Reference" to "Windows Script Host Object Model"

Further documentation can be found here:  http://msdn.microsoft.com/en-us/library/a74hyyw0(v=vs.85).aspx

0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:l0o3
ID: 35135141
graye can u attach the project?
0
 
LVL 41

Expert Comment

by:graye
ID: 35137756
I'm confused... are you asking how to add a reference to your project?   or are you asking how to use the Shortcut class?
0
 

Author Comment

by:l0o3
ID: 35138125
        Shell = New IWshRuntimeLibrary.IWshShell_Class
        Shortcut = Shell.CreateShortcut("g:\program files\ltcr\mgx.exe /nomutex")

Open in new window



The shortcut pathname must end with .lnk or .url.
0
 
LVL 41

Expert Comment

by:graye
ID: 35139015
Take a look at the documentation on what properties that you can set for a shortcut.  There is a pretty good example there.

http://msdn.microsoft.com/en-us/library/xsy6k3ys(v=vs.85).aspx

The creation of the shortcut is just the begining of the process.  After it's created, you fill in the properties you want and then do a Save operation
0
 

Author Comment

by:l0o3
ID: 35140240
i cant run

can you add project for me?

tnx
0
 
LVL 5

Accepted Solution

by:
MedievalWarrior earned 125 total points
ID: 35140512
0
 

Author Closing Comment

by:l0o3
ID: 35142964
tnx
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 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