Création d'un raccourci Notepad++ sur le bureau avec un script PowerShell - Creating a Notepad++ desktop shortcut using a PowerShell script

Création d'un raccourci Notepad++ sur le bureau avec un script PowerShell - Creating a Notepad++ desktop shortcut using a PowerShell script

Moyennant un script powershell à déployer sur les postes puis à exécuter, il est possible de créer le raccourci sur le bureau de l'utilisateur.
Exemple de script "CreateShortcut.ps1" à utiliser pour créer un raccourci pour Notepad++ sur le bureau de tous les utilisateurs d'un poste:

Using a PowerShell script deployed and then executed on the endpoints, it is possible to create a shortcut on the user's desktop.

Example of a "CreateShortcut.ps1" script to create a shortcut for Notepad++ on the desktop of all users on a workstation:

$WshShell = New-Object -ComObject WScript.Shell​ $Shortcut = $WshShell.CreateShortcut("C:\Users\Public\Desktop\Notepad++.lnk") $Shortcut.TargetPath = "C:\Program Files\Notepad++\notepad++.exe" $Shortcut.Save() 

Il suffira alors de créer une tâche avec les commandes suivante : 

You would then simply need to create a task with the following commands:

  1. Déployer un fichier : utilisant le script "CreateShortcut.ps1" pour le déployer dans "C:\Temp" par exemple

Deploy a file: use the CreateShortcut.ps1 script and deploy it, for example, to C:\Temp

  1. Exécuter une commande : powershell.exe -ExecutionPolicy Bypass -f  'C:\Temp\CreateShortcut.ps1'

Execute a command: powershell.exe -ExecutionPolicy Bypass -f 'C:\Temp\CreateShortcut.ps1'

De cette manière, le raccourci devrait correctement se créer sur le bureau des utilisateurs des postes.

This way, the shortcut should be correctly created on the desktop of users on the targeted devices.