Internet Shortcut placed on all users desktop

Posted on 2011-02-16
Last Modified: 2012-05-11
I would like a simple batch file that will place an internet shortcut ( with the icon file for the site as the icon to the all users desktop.

Is there simple code I could use to accomplish this?

Question by:tanya_andreasen
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34909708
use the location

C:\Documents and Settings\All Users\Desktop

so it will be visible by all users... instead of looping all users...

Accepted Solution

rawinnlnx9 earned 500 total points
ID: 34909709
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34909729
here is a sample code that you can make use of it
sub DesktopShortCuts()
  Dim FSO, strDesktopPath, strMyAppPath, objShortcutUrl
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set WshShell = CreateObject("WScript.Shell")

  strDesktopPath = WshShell.SpecialFolders("Desktop")
  strMyAppPath = WshShell.SpecialFolders("MyDocuments")

  Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\Octopus-HR.lnk")

  'FSO.CopyFile "\\server\netlogon\program\program.ico", strMyAppPath & "\program.ico"
  FSO.CopyFile "D:\Library\img\ico\craxddrt_16837.ico", strMyAppPath & "\program.ico"

  objShortcutUrl.TargetPath = ""
  objShortcutUrl.IconLocation = strMyAppPath & "\program.ico"
End Sub


Open in new window

LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34909749
help on SpecialFolders

you can use

strMyAppPath = WshShell.SpecialFolders("AllUsersDesktop")

LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 34909763

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Click on Too…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question