Creating Desktop Shortcuts?
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
7 posts
Page 1 of 1
Can someone help me out and explain how to create desktop short cuts in Vb.Net
if would be very helpful to my program that i am making
wahooo;
if would be very helpful to my program that i am making

Last edited by Livengood on Thu Mar 04, 2010 11:36 pm, edited 1 time in total.
i think thats done in C++....
i have tried google found nothing that worked :(
i have tried google found nothing that worked :(
I can do that in VB, just convert the code, plus it;s NOT C++, it;s C#. Learn to tell the differance.
Hello,
Make a reference to the "Windows Script Host Object Model" COM library and then in your code add:
Make a reference to the "Windows Script Host Object Model" COM library and then in your code add:
Code: Select all
Then when you want to create the shortcut, like in a "Form_Load" or "Button_Click" or something use:Imports IWshRuntimeLibrary
Code: Select all
Change "NameOfShortCut.lnk" to the whatever you want to call the shortcut filename.Dim NewShell As WshShellClass = New WshShellClass
Dim DeskTopShortCut As IWshRuntimeLibrary.IWshShortcut
Dim DesktopFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
DeskTopShortCut = CType(NewShell.CreateShortcut(DesktopFolder & "\NameOfShortCut.lnk"), IWshRuntimeLibrary.IWshShortcut)
DeskTopShortCut.TargetPath = Application.ExecutablePath
DeskTopShortCut.Save()
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
o i see, i wasnt really sure if it was C++ or C#
i just need to find out how to do that, i have made a pro. installer program.... i am going to release the code when i am done
i just need to find out how to do that, i have made a pro. installer program.... i am going to release the code when i am done

thanks for the shortcut code ;)
7 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023