News:

Ryan's Free Online Tech Forum
redux.

Main Menu

Create shortcut on desktop

Started by scythe944, August 13, 2020, 11:31:13 AM

Previous topic - Next topic

scythe944

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