0

Basically in an effort to configure and customise the start screen for our Windows 8/2012 users I have resorted to creating shortcuts and copying the layout to each user. With powershell I am able to create my links and shortcuts by running the following:

$ws = New-Object -comObject WScript.Shell
$Dt = $ws.SpecialFolders.item("StartMenu\Wes")
$URL = $ws.CreateShortcut($Dt + "\MYWEBSITE.url")
$URL.TargetPath = "http://MYWEB.MYDOMAIN.com"
$URL.Save()

This runs, and if I was to update a url it will also update it in the start screen.

My question is, does anyone know how i can change it so that it removes a shortcut?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328

2 Answers2

2

A shortcut is just a file. Just call a command to delete it. BTW, if you're targeting W8/2012 or newer, I would recommend you to move away fro vbscript and onto PowerShell for stuff like this. What you're doing in the above example can easily be done with the "New-Shortcut" cmdlet.

Trondh
  • 3,221
  • 1
  • 25
  • 34
0

There is no New-Shortcut cmdlet in Server 2012. There are scripts called that, including the one in TechNet Gallery (http://gallery.technet.microsoft.com/scriptcenter/New-Shortcut-4d6fb3d8), but no native cmdlet.

Pat Richard
  • 69
  • 1
  • 6