Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file to place a shortcut on a user's desktop?

Status
Not open for further replies.

Kumorigoe

IS-IT--Management
Sep 11, 2012
21
US
I need to know how to make a batch file for my users to click to place a shortcut to a certain webpage on their desktop. Many of them aren't really that good with URLs and the Favorites list and whatnot. If I can gove them something to click that does the work for them, that's best.

Thanks in advance!
 
As the name of this site says, it's the place to share tech tips. Your post contains no tip or solution, so it's useless for community. I really hate to find a bunch of "I figured it out" instead of real solution. Sorry.

===
Karlis
ECDL; MCSA
 
I wrote a VB script to do it and then used a zip archive to send it through email.

Script below:

Option Explicit

On Error Resume Next

Dim objShell
Dim objDesktop
Dim objLink
Dim strAppPath
Dim strWorkDir
Dim strIconPath



strWorkDir ="C:\windows"
strAppPath = " 'you have to use your URL to Internet site or path to specific program
strIconPath = "C:\Windows\System32\oemlogo.bmp" 'specify the path to the icon please change to your valid path

Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
Set objLink = objShell.CreateShortcut(objDesktop & "\Phone List.lnk") 'change here To your shortcut name


objLink.Description = "Dallas-Fort Worth Phone List" 'replaec with your description
objLink.IconLocation = strIconPath
objLink.TargetPath = strAppPath
objLink.WindowStyle = 3
objLink.WorkingDirectory = strWorkDir
objLink.Save



After saving as a .vbs file, I put it inside a zip archive to be able to send through email.
 
Writing a short step-through for the actual user would have helped him/her more than this, probably blocked by security-tools, silly and simple script [mad]
 
If it's more complicated than a double-click, my users get confused and then I end up going to each and every desk to manually do it.
 
Are you running an Active Directory environment? If so, a Group Policy would get this done much easier...no scripting required (or you could have the script run as a Logon script)

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top