473,581 Members | 3,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating Shortcuts

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

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

IWshRuntimeLibr ary.WshShortcut

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

It worked for me ;)

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"VladimirHorowi tz" <Vl************ **@discussions. microsoft.com> wrote in message
news:6C******** *************** ***********@mic rosoft.com...
Can someone show me the way to create a shortcut to the file eg "c:\test.ex e"
and place it in the folder eg "c:\"? (programmatical ly). 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.ex e"
and place it in the folder eg "c:\"? (programmatical ly). 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
2020
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 internet shortcuts on windows? (as used for Favorites). Thank you, --
6
3238
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." exception. The problem is that this exception isn't raised somewhere in a method, so it just shows up, and it causes the application to shut down. ...
1
1669
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 tried to set Conditions on the folders "User's desktop" and "User's Program Menu", but the conditions doesnt seem to affect shortcuts, only physical...
1
2224
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 store it in along with the URL and have it created on demand. Is there a way I can do this?
3
2253
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 you
1
1656
by: tomp | last post by:
Does anyone know how to create file shortcuts in a VB program?
1
1093
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 parameter is filled in by reading in a file with all the
5
6539
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 ToolStripMenuItem is inside a Form, i tryed with different shortcuts and some work, some don't. For instance, 'Keys.Control | Keys.R' doesn't work either....
331
14770
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 most versatile text editor. And, besides text editing, it also serves as a
2
1664
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 want it to, with 1 exception. I have created the infamous fonts folder in order for it to install fonts, but it's only putting shortcuts to them in the...
0
7789
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8141
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8300
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8167
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5358
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3802
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3817
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.