You can create shortcuts on your users’ desktops in a few simple steps, thanks to PowerShell. In this blog, I’ll show you how to create the PowerShell script you need to get the job done. Then, we’ll deploy our script in a few different ways.
Ready to tick the completed box on all those tickets from finance asking where the accounting software is on their computers? I genuinely love that for you. Let’s get to it!
How to use PowerShell to create a script for shortcuts
First, we need to write our script in PowerShell. The good news? You don’t have to write anything, as we’ve done that for you. You do enough around these parts, my friend.
Below is an example script in PowerShell that installs a shortcut to Notepad on the desktop. You can swap out the $TargetFile
path with whatever software you’d like.
$TargetFile = "$env:SystemRoot\System32\notepad.exe" $ShortcutFile = "$env:Public\Desktop\Notepad.lnk" $WScriptShell = New-Object -ComObject WScript.Shell $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) $Shortcut.TargetPath = $TargetFile $Shortcut.Save()
Now, let's get this time-saving script on your machine as a .ps1 file.
1. Launch PowerShell ISE (that stands for Integrated Scripting Environment) as an admin.
2. Copy and paste the code above into the scripting block (the area with the white background by default).
3. Name the script and save it as a .ps1 file.
When you run the script, you should see a Notepad shortcut appear on your desktop.
Now, we have a shiny new script, ready to deploy. Let's deploy it to certain machines in our environment using PDQ Deploy and PDQ Connect.

PowerShell power user?
Check out The PowerShell Podcast: a weekly exploration of tips and tricks to help you step up your PowerShell game.
How to use PDQ Deploy to create shortcuts on user desktops
Deploying a PowerShell script using PDQ Deploy is as simple as creating a package and then deploying it. If you feel spoiled by our Package Library, don't fret — creating custom packages is a piece of cake!
We even have a step-by-step video on how to do this if you prefer that format instead.
Loading...
How to create a custom package in PDQ Deploy
1. Launch the PDQ Deploy console. Then, click New Package.
2. Name your package. I’ll name mine Create Notepad Desktop Shortcut.
3. Click on Steps, and then click — you guessed it — PowerShell.
4. Give your step a name (I’ve named mine Deploy PowerShell Script), and then click Insert PowerShell Script...
5. Import your PowerShell script (the .ps1 file you created moments ago), and then click Save.
How to deploy custom packages using PDQ Deploy
Now, let’s deploy the custom package we just made.
1. From the PDQ Deploy console, find your package in the panel to the left. Right-click it, and then click Deploy Once.
2. Add your target machines, and click Deploy Now.
No, really — it’s that simple.
But if you’re feeling froggy, you can use PDQ Inventory to automate the installation process. Do this by creating a dynamic collection in PDQ Inventory. Additionally, you can schedule software deployments, automatically retry failed machines, use Wake-on-LAN, and much more.
Hey, they don’t call PDQ the Swiss Army knife for sysadmins for nothing!
How to use PDQ Connect to create shortcuts on user desktops
The process to create shortcuts on user desktops using PDQ Connect looks very similar to what we just did in PDQ Deploy. But with PDQ Connect, you have the luxury of cloud-based deployments, which makes remote device management easier than ever.
You know the drill — let’s make that custom package and then deploy it!
How to create a custom package in PDQ Connect
1. Launch PDQ Connect.
2. From the PDQ Connect console, click Packages, then Create package.
3. Give your package a name.
4. Click the drop-down menu next to Add install step. Then, click Add script step.
5. Give the step a name, and then click Import .ps1 to import your PowerShell script. Click Save.
How to deploy custom packages using PDQ Connect
Now, we can deploy our package.
1. From the main screen in PDQ Connect, click Deployments, and then click Deploy.
2. In the Search packages field, find the package you just created. Then, choose the devices or groups you want to deploy it to. Click Deploy.
And you're done!
Now that you’ve cracked the code on creating shortcuts on user desktops in just a few clicks, I bet you’re wondering about other ways you can make your life as a sysadmin easier. My pro tip: You can automate patch management, gain real-time environment visibility, and support and secure your endpoints with PDQ Connect. Try it free for 14 days and kiss those repetitive, boring, I’d-rather-be-anywhere-but-here tasks goodbye.