Internet Shortcut placed on all users desktop

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?

Who is Participating?

Improve company productivity with a Business Account.Sign Up

HainKurtSr. System AnalystCommented:
use the location

C:\Documents and Settings\All Users\Desktop

so it will be visible by all users... instead of looping all users...
HainKurtSr. System AnalystCommented:
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

HainKurtSr. System AnalystCommented:
help on SpecialFolders

you can use

strMyAppPath = WshShell.SpecialFolders("AllUsersDesktop")

HainKurtSr. System AnalystCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.