Weekly Tip 12

Create shortcut from PowerShell:

# define shortcut directory

$short_dir = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\<application>”

# create start menu folder if it doesn’t already exist

If ( (test-path $short_dir) -eq $false ) { new-item -type directory $short_dir }

# create shortcut

$target = “<path to exe>”

$shortcut_lnk = “$short_dir\<name>.lnk”

$wscriptshell = New-Object -ComObject WScript.Shell

$Shortcut = $WScriptShell.CreateShortcut($Shortcut_lnk)

$Shortcut.TargetPath = $Target

$Shortcut.Save()

Share:

Facebook
Twitter
LinkedIn

Contact Us

Name
=
On Key

More Posts

Endpoint Management

How to Prevent a Stryker Attack

The Stryker breach did not happen because of advanced hacking. It happened because one privileged account was enough to take control. A compromised global administrator can: Shut down access Push malicious changes Wipe devices Lock users

Read More »