473,549 Members | 2,247 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 39353

"thi" <th******@hotma il.comkirjoitti
viestissä:ux*** ***********@TK2 MSFTNGP04.phx.g bl...
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******@hotma il.comwrote in message
news:ux******** ******@TK2MSFTN GP04.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.co m

"thi" <th******@hotma il.comwrote in message
news:ux******** ******@TK2MSFTN GP04.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
26996
by: Eskimo Joe | last post by:
I am trying to create a desktop icon using VB6. is this possible? -p
1
2260
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" to this, but don't see that it allows for this? Am I missing something?
4
4392
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 shortcut to my program/utility (2) Entry in Windows' Start --> Program Menu. Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2)...
3
4161
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
31217
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 menu I clicked Create Shortcut to User's Desktop. In the right pane of the setup/File System window the object Shortcut to User's Desktop appeared. ...
3
1746
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 add some code , that create the shortcut for our user, the user might click some button telling "I want make a shortcut for this site"
0
2263
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 application once it has been installed. I have added a condition to the User's Desktop named "DESKTOPSHORTCUT" (I have used several names, this is...
3
3924
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
7647
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"); var oUrlLink = WshShell.CreateShortcut(strDesktop + "\Link to Help Page.url"); oUrlLink.TargetPath = "http://www.someurl.com"; oUrlLink.Save();
0
7743
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. ...
1
7504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7832
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
6074
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3518
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
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
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 we have to send another system
1
1083
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
786
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.