Created
November 16, 2015 01:10
-
-
Save kenpb/b73bd377f68becc18baf to your computer and use it in GitHub Desktop.
A simple script to create shortcuts with powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$root = "\\VBOXSRV\" | |
$folders = "common", "vagrant" | |
$nCOM = New-Object -ComObject WScript.Shell | |
$folders | ForEach-Object { | |
$shortcut = $nCOM.CreateShortcut("$Home\Desktop\" + $_ + " (VBOXSRV).lnk") | |
$shortcut.TargetPath = $root + $_ | |
$shortcut.Save() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://mickitblog.blogspot.com/2014/06/powershell-pinning-shortcuts-to-taskbar.html | |
# http://gallery.technet.microsoft.com/scriptcenter/b66434f1-4b3f-4a94-8dc3-e406eb30b750 | |
$shell = new-object -com "Shell.Application" | |
$folder = $shell.Namespace('C:\Windows') | |
$item = $folder.Parsename('notepad.exe') | |
$verb = $item.Verbs() | ? {$_.Name -eq 'Pin to Tas&kbar'} | |
if ($verb) {$verb.DoIt()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment