Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Internet Shortcut placed on all users desktop

Posted on 2011-02-16
5
Medium Priority
?
377 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
[X]
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
5 Comments
 
LVL 59

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 2000 total points
ID: 34909709
0
 
LVL 59

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 59

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 59

Expert Comment

by:HainKurt
ID: 34909763
0

Featured Post

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

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 viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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 …

718 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