Solved

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

Posted on 2011-03-14
10
844 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
 

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now