0

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

1
  • possible duplicate of How to create a shortcut using Powershell. Pretty sure it is no different. Just use your URL as the target and add a URL extension. Commented Apr 6, 2015 at 11:05

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.