Now whenever you want to create a shortcut from PowerShell, call it like this: Set-ShortCut "C:\Path\to\Save\Shortcut.lnk" "C:\Path\To\Program.exe" $Shortcut = $WshShell.CreateShortcut($SourceExe) $WshShell = New-Object -comObject WScript.Shell If you don’t know the path, simply entering $pwd in PowerShell will give you the location. Then place it inside your $pwd (Program Working Directory). Save below script in a file named set-shortcut.ps1. If you want to create shortcuts from command-line in Windows, here are some ways: Windows PowerShell Sure, there is the mklink utility but it creates a “ symbolic link” and not a “shortcut”. It is extremely easy to create shortcut to a file or folder using the Shortcut Create wizard in Windows, but there’s no direct way to create a shortcut from the command line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |