Solved

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

Posted on 2011-03-14
10
851 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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