# Desktop_CreateShortCut

> Creates a shortcut on in a specified location.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/desktop-functions/desktop-createshortcut/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Creates a shortcut on in a specified location

### Syntax

Desktop_CreateShortCut (sDescription, sShortcutFileName, sTargetPath, sArguments, sWorkingDirectory, sShortcutFolder, sIconLocation, iWindowStyle, sHotKey)

### Parameters

#### sDescription (String)

A description for the shortcut (e.g. "Calculator)

#### sShortcutFileName (String)

Name of the .lnk file (e.g. Calc.lnk)

#### sTargetPath (String)

Full path to the application (e.g. C:\Windows\calc.exe)

#### sArguments (String)

Commandline arguments, if any

#### sWorkingDirectory (String)

Working directory for the application

#### sShortcutFolder (String)

You can use [Special folders Constants](/capainstaller/vb-scripting-library/addendum/special-folders-constants/) together with a path

#### sIconLocation (String)

Iconlocation (often found in the .exe file)

#### iWindowStyle (Integer)

[Windows Style Constants](/capainstaller/vb-scripting-library/addendum/windows-style-constants/) (minimized, normal, maximized, etc.)

#### sHotKey (String)

Hotkey for executing shortcut (e.g. CTRL+ALT+W)

### Example

**VBScript**

```vb
'Creates a shortcut on the users start menu
If bStatus Then bStatus=Desktop_CreateShortCut("Creates CapaInstaller scripts","CapaInstaller Manager.lnk",gsProgramFiles & "\CapaInstaller Manager\ciman.exe","", gsProgramFiles & "\CapaInstaller Manager",Folder_Programs & "\CapaInstaller",gsProgramFiles & "\CapaInstaller Manager\Ciman.exe",0,"CTRL+ALT+C") 
 
'Create a shortcut in c:\temp
If bStatus Then bStatus=Desktop_CreateShortCut("Creates CapaInstaller scripts","CapaInstaller Manager.lnk",gsProgramFiles & "\CapaInstaller Manager\ciman.exe","", gsProgramFiles & "\CapaInstaller Manager","C:\temp",gsProgramFiles & "\CapaInstaller Manager\Ciman.exe",0,"CTRL+ALT+C") 
 
'Creates a shortcut on all users desktop
If bStatus Then bStatus=Desktop_CreateShortCut("Create advanced CAD drawings","AutoCad 2000.lnk",gsProgramFiles & "\Autodesk\Autocad 2000\autocad.exe","/new /ddeexec=2", gsTempDir,Folder_AllUsersDesktop,gsProgramFiles & "\Autodesk\AutoCad\Autocad.ico",0,"")
 
'Creates a shortcut to notepad in the Send To folder.
If bStatus Then bStatus=Desktop_CreateShortCut("","Notepad.lnk",gsWindowsDir & "\notepad.exe","", gsTempDir,Folder_SendTo,gsWindowsDir & "\notepad.exe",0,"")
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Desktop functions](/capainstaller/vb-scripting-library/desktop-functions/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
