Skip to content

Greg Altman

Solutions, Learnings, PowerShell, and random thoughts.

Menu
  • Home
  • Tech Reviews
  • Github Repos
  • About Me
Menu

Powershell Tuesday Quick Tip #6

Posted on April 10, 2018 by Greg Altman

This week’s tip is a bit longer – it’s actually a little script to remotely create a shortcut to a network file share on a user’s desktop. This one comes in handy when explaining how to make a shortcut over the phone proves …. difficult.

[code lang=’powershell’]
$PC = ‘Luke-Laptop.rebellion.org’
$User = ‘LSkywalker’
$TargetPath = “\\tactics.rebellion.org\death_star_plans\”
$ShortcutFile=”\\$PC\C$\Users\$user\Desktop\Death Star.lnk”
$Obj = New-Object -COMObject Wscript.Shell
$Shortcut = $Obj.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetPath
$Shortcut.Save()
[/code]

This one is a good candidate for getting wrapped up in a function and added to an “Admin Toolkit Module”.

Share this:

  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

Disclaimer: The thoughts, ideas and code on this blog are my own and do not represent any employer, past or present. All code is for demonstration and educational purposes only. Use at your own risk

Categories

  • Ad-hoc and Random
  • Blog
  • Career
  • Cloud
  • Events
  • PowerShell
  • Reviews
  • Security
  • Server Stuff
  • Troubleshooting
  • Uncategorized

Overall Rating
0.0
© 2026 Greg Altman | Powered by Minimalist Blog WordPress Theme
%d