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
  • 4
LVL 51

Expert Comment

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 51

Expert Comment

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 51

Expert Comment

ID: 34909749
help on SpecialFolders

you can use

strMyAppPath = WshShell.SpecialFolders("AllUsersDesktop")

LVL 51

Expert Comment

ID: 34909763

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now