• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 877
  • Last Modified:

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

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
l0o3
Asked:
l0o3
  • 5
  • 4
1 Solution
 
grayeCommented:
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
 
l0o3Author Commented:
i dident IWshRuntimeLibrary.IWshShell_Class class

where is this?
0
 
grayeCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
l0o3Author Commented:
graye can u attach the project?
0
 
grayeCommented:
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
 
l0o3Author Commented:
        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
 
grayeCommented:
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
 
l0o3Author Commented:
i cant run

can you add project for me?

tnx
0
 
l0o3Author Commented:
tnx
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now