473,498 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How create a desktop shortcut in c#?

thi
Hi,

How do i create an application shortcut on desktop programmically in C#? I
have done some shortcut coding before in visual basic 6 using windows
scripting host but later found out that scripting codes get block by some
application such as Norton and McAfee.

Would anyone mind give me some help or better still give me some sample
code. I would prefer API calls then windows scripting host.

Many thank you in advance.
Jul 12 '06 #1
3 39347

"thi" <th******@hotmail.comkirjoitti
viestissä:ux**************@TK2MSFTNGP04.phx.gbl...
Hi,

How do i create an application shortcut on desktop programmically in C#?
I have done some shortcut coding before in visual basic 6 using windows
scripting host but later found out that scripting codes get block by some
application such as Norton and McAfee.

Would anyone mind give me some help or better still give me some sample
code. I would prefer API calls then windows scripting host.
Look into
http://www.sorrowman.org/c-sharp-pro...o-desktop.html

there's example how to make URL shortcut or app shortcut to desktop. There
probably are better ways than these though.
Jul 12 '06 #2
Try this:
http://msdn2.microsoft.com/en-us/lib...64(d=ide).aspx

chanmm

"thi" <th******@hotmail.comwrote in message
news:ux**************@TK2MSFTNGP04.phx.gbl...
Hi,

How do i create an application shortcut on desktop programmically in C#?
I have done some shortcut coding before in visual basic 6 using windows
scripting host but later found out that scripting codes get block by some
application such as Norton and McAfee.

Would anyone mind give me some help or better still give me some sample
code. I would prefer API calls then windows scripting host.

Many thank you in advance.

Jul 12 '06 #3
thi,

In order to do this, you will want to use the IShellLink interface as
well as the IPersistFile interface (through COM interop).

Here is an article that goes into detail what you need to do it, as well
as sample code:

http://www.vbaccelerator.com/home/NE...ts/article.asp
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"thi" <th******@hotmail.comwrote in message
news:ux**************@TK2MSFTNGP04.phx.gbl...
Hi,

How do i create an application shortcut on desktop programmically in C#?
I have done some shortcut coding before in visual basic 6 using windows
scripting host but later found out that scripting codes get block by some
application such as Norton and McAfee.

Would anyone mind give me some help or better still give me some sample
code. I would prefer API calls then windows scripting host.

Many thank you in advance.

Jul 13 '06 #4

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

Similar topics

5
26988
by: Eskimo Joe | last post by:
I am trying to create a desktop icon using VB6. is this possible? -p
1
2244
by: Tom | last post by:
I created an msi using the Setup Wizard, but don't seem to be able to create a shortcut to the applicaton on the desktop (or prompt for one) or the menu. Also, I would like to add an "uninstall"...
4
4381
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
3
4152
by: Michael D. Murphy | last post by:
Hi, I am searching for a way to creat desktop shortcuts when running the setup files that were created within a VB solution using the setup wizard. Thanks, Michael
7
31196
by: GrandpaB | last post by:
I would appreciate assistance learning how to create a Desktop shortcut in my setup project. In the left pane of the Setup/File System window I right-clicked User's Desktop. From the contex...
3
1742
by: baroque Chou | last post by:
We build a web site and have some registred user, we want to offer such a feature that the user can access our site from his or her desktop shortcut and want it be log on automatic. So I plan to...
0
2250
by: peter.bittner | last post by:
I have developed a Windows application in Visual Studio .NET 2003 and created a Setup project for it. In the File System Editor I have added a shortcut to the User's Desktop folder to point to the...
3
3913
by: sanghavi | last post by:
how to create a set up project in vb.net..how to run an application on a different machine
1
7629
by: Mosa | last post by:
Dear all, I want to create a desktop shortcut using this code function MakeShortcut() { var WshShell = new ActiveXObject("WScript.Shell"); strDesktop = WshShell.SpecialFolders("Desktop");...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6881
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
7375
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...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3088
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
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...

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.