Reputation: 33
i was inquiring if there are options to create a url shortcut to be placed on c:\users\username\favorites to be applied to be added to the login script of the user on Active directory to create the favorites for any user i tried searching all over the internet and i only found "MD" and "MKDir" commands
Upvotes: 0
Views: 6699
Reputation: 46710
Not the most PowerShell answer but this is the widely used one with the best compatibility in versions. Much like this answer but small changes for URLs
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Favorites\Google.url")
$Shortcut.TargetPath = "http://www.google.ca"
$Shortcut.Save()
This will make a shortcut to Google in your favorites. $Home
being one of PowerShell's Automatic Variables
If you happen to have PowerShell 5.0 it can now do this natively. Again refer to this answer for more information
Upvotes: 3