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
Picture of Matt Tinney

Matt Tinney

Professional IT executive & business leader having decades of experience with Microsoft technologies delivering modern-day cloud & security solutions.

Contact Us

=
On Key

More Posts

WME Cybersecurity Briefings No. 024
Cyber Security

WME Security Briefing 28 August 2024

GhostWrite Vulnerability in T-Head CPUs Exposes Devices to Unrestricted Access Overview A critical architectural flaw in T-Head’s XuanTie C910 and C920 RISC-V CPUs was uncovered by recent research from the CISPA Helmholtz Center for Information Security. Dubbed GhostWrite, the vulnerability

Click Here to Read Full Article »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.

=