473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Creating Shortcuts

Can someone show me the way to create a shortcut to the file eg "c:\test.exe"
and place it in the folder eg "c:\"? (programmatically). Example in vb.net i
need, but either in c# or j# are accepted.

Tnx
Jul 22 '05 #1
2 1069
I needed that functionality and couldn't find any built-in to the framework, so I used the WSH shell library:

IWshRuntimeLibrary.WshShortcut

(Import "IWshRuntimeLibrary" from the COM tab of "Add Reference...")

It worked for me ;)

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"VladimirHorowitz" <Vl**************@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Can someone show me the way to create a shortcut to the file eg "c:\test.exe"
and place it in the folder eg "c:\"? (programmatically). Example in vb.net i
need, but either in c# or j# are accepted.

Tnx

Jul 22 '05 #2
>Can someone show me the way to create a shortcut to the file eg "c:\test.exe"
and place it in the folder eg "c:\"? (programmatically). Example in vb.net i
need, but either in c# or j# are accepted.


In addition to Dave's suggestion, here's another way to do it

http://www.msjogren.net/dotnet/eng/s..._shelllink.asp

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard Townsend | last post by:
I've seen the python.faqts page: http://www.faqts.com/knowledge_base/view.phtml/aid/4475/fid/538 on how to create windows shortcuts using Python. Does anyone know if this be adapted to create...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
1
by: Richard Johansson | last post by:
Hi, I want to create an option for creating shortcuts to my application on the users desktop and Start menu in the setup. In my deployment project i have created the necessary checkboxes, and...
1
by: Jefferson Cowart | last post by:
I'm looking for a way to create new shortcuts for a user. While I realize I could just pre-create all the shortcuts and just copy them in. I would prefer just to be able to specify the file i want to...
3
by: Marius Rus | last post by:
I have an application write in c# and i want to offer to the user to create himself shortcuts with icons for the main menu items. I will very much appreciate if will receive an helping hand. Thank...
1
by: tomp | last post by:
Does anyone know how to create file shortcuts in a VB program?
1
by: googleboy | last post by:
I need to create about 2000 shortcuts to a batch file. The shortcuts need to have: Name: %parameter%.lnk Target: n:\Path\To\batchfile.bat %parameter% Start In: n:\Path\To\ Where the...
5
by: PAzevedo | last post by:
With ToolStripMenuItem objects i created a 'Tools' menu and from that menu droped an Item to which i assigned a ShortcutKey of 'Keys.Control | Keys.E', and the shortcut doesn't work. This...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
2
by: Dmenace | last post by:
Microsoft blows my mind sometimes, what the hell were they thinking? Oh, wait they weren't, that's right. Anyway, I've got a Setup and Deployment added to my project, and it does everything I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.