[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 487
  • Last Modified:

Need script to create shortcut on client desktops to helpdesk website

Hello Experts,
I been working on this for a while and have had little luck...probablly since I am a novice at scripting. I need a script that will create an icon (using a .ico) in "AllUsersPrograms" program files directory and pin it to the start menu. When users would click on this icon...it would take them to a helpdesk website on the internet. Ideally, I would like to deploy this with group policy. I found the code below and tried to adapt it to my situation but cound not get the icon to appear on the desktop. Just a generic IE icon appeared...but it worked otherwise. I also included some other code below that pins items to start menu that I found on an MSDN forum. Thanks a bunch! -John
Dim oFSO, oLnk, WshShell, strDesktop
set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oFSO = CreateObject("Scripting.FileSystemObject")
Set oLnk = oFSO.CreateTextFile(strDesktop & "\Poco Oil Website.url", True)
oLnk.WriteLine "[DEFAULT]"
oLnk.WriteLine "BASEURL="
Here, for example, is a script that pins the Windows Calculator (calc.exe) to the Start Menu:
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("calc.exe")
oLnk.WriteLine "[InternetShortcut]"
oLnk.WriteLine "URL="
oLnk.WriteLine "IconFile="

Open in new window

1 Solution
Hi, you should create a link file using the CreateShortcut method.


Dim objFSO, objLnk, objShell, strDesktop, strStartMenu
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strDesktop = objShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Desktop"
strStartMenu = objShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu"
Set objLnk = objShell.CreateShortcut(strDesktop & "\Poco Oil Website.lnk", True)
objLnk.TargetPath = ""
objLnk.Description = "Help Desk"
objLnk.IconLocation = ""
objFSO.CopyFile strDesktop & "\Poco Oil Website.lnk", strStartMenu & "\Poco Oil Website.lnk", True

Open in new window


Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now