Solved

Internet Shortcut placed on all users desktop

Posted on 2011-02-16
5
367 Views
Last Modified: 2012-05-11
I would like a simple batch file that will place an internet shortcut (www.mysite.com) 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?

Thanks!
0
Comment
Question by:tanya_andreasen
  • 4
5 Comments
 
LVL 51

Expert Comment

by:HainKurt
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...
0
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 500 total points
ID: 34909709
0
 
LVL 51

Expert Comment

by:HainKurt
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 = "https://www.program-site.com/portal/index.html"
  objShortcutUrl.IconLocation = strMyAppPath & "\program.ico"
  objShortcutUrl.Save
End Sub

DesktopShortCuts()

Open in new window

0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34909749
help on SpecialFolders

http://msdn.microsoft.com/en-us/library/0ea7b5xe(v=vs.85).aspx

you can use

strMyAppPath = WshShell.SpecialFolders("AllUsersDesktop")

0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34909763
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
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 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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

861 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