Link to home
Start Free TrialLog in
Avatar of tanya_andreasen
tanya_andreasenFlag for United States of America

asked on

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?

Avatar of HainKurt
Flag of Canada image

use the location

C:\Documents and Settings\All Users\Desktop

so it will be visible by all users... instead of looping all users...
Avatar of rawinnlnx9
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

help on SpecialFolders

you can use

strMyAppPath = WshShell.SpecialFolders("AllUsersDesktop")