Skip to main content

10 posts tagged with "Windows"

View All Tags

Create shortcut .lnk in CLI

· One min read

PowerShell

$ws = New-Object -ComObject WScript.Shell
$ws.CurrentDirectory = $PWD
$s = $ws.CreateShortcut('url.lnk')
$s.TargetPath = 'http://example.com'
# $s.TargetPath = 'file.txt'
$s.Save()