JacobyTech Forum

General Category => Scripts => Topic started by: scythe944 on August 13, 2020, 11:31:13 AM

Title: Create shortcut on desktop
Post by: scythe944 on August 13, 2020, 11:31:13 AM
A script that puts a shortcut to MS Paint on the desktop.  Of course, this can be changed to any shortcut.


Save as a vbs and put in group policy as a login script

Option Explicit
Dim objShell, objDesktop, objLink
Dim strAppPath, strWorkDir, strIconPath

strWorkDir ="C:\windows"
strAppPath = "%SystemRoot%\system32\mspaint.exe"
strIconPath = "%SystemRoot%\system32\mspaint.exe"

Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
Set objLink = objShell.CreateShortcut(objDesktop & "\Paint.lnk")


objLink.Description = "Paint"
objLink.HotKey = "CTRL+SHIFT+X"
objLink.IconLocation = strIconPath
objLink.TargetPath = strAppPath
objLink.WindowStyle = 3
objLink.WorkingDirectory = strWorkDir
objLink.Save

WScript.Quit