Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

create shortcut C# WPF

At first, Project > Add Reference > COM > Windows Script Host Object Model.

using IWshRuntimeLibrary;

private void CreateShortcut()
{
  object shDesktop = (object)"Desktop";
  WshShell shell = new WshShell();
  string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"Notepad.lnk";
  IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
  shortcut.Description = "New shortcut for a Notepad";
  shortcut.Hotkey = "Ctrl+Shift+N";
  shortcut.TargetPath = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"
otepad.exe";
  shortcut.Save();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# isalphanumeric 
Csharp :: distinct and not null c# 
Csharp :: getcomponent 
Csharp :: 1080 / 7 
Csharp :: All and Any linq c# examlpe replace 
Csharp :: c# array does not contain a definition for cast 
Csharp :: leave two decimal in double c# 
Csharp :: how to create more accurate searching c# 
Csharp :: how to count specific controls in a container c# 
Csharp :: poems 
Csharp :: entity framework dynamic search 
Csharp :: how to close a popup wpf c# on click event 
Csharp :: there is no renderer attached to the gameobject 
Csharp :: c# random change seed 
Csharp :: tuples in c# 
Csharp :: how to declare two int variables in only one line c# 
Csharp :: Permutation and Combination in C# 
Csharp :: c# wait without GUI blocks 
Csharp :: dotnet DB context register 
Csharp :: return array in c# 
Csharp :: page refresh on button click in c# 
Csharp :: c# loop backwards 
Csharp :: deserialize list of objects c# 
Csharp :: unity destroy gameobject with delay 
Csharp :: c# array inst working 
Csharp :: select list that does not exis in another C# list 
Html :: html yuan symbol 
Html :: how to open link in new tab 
Html :: meta author 
Html :: python jupyter markdown color 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =