Solved

Internet Shortcut placed on all users desktop

Posted on 2011-02-16
5
362 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to count occurrences of each item in an array.
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)

757 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

22 Experts available now in Live!

Get 1:1 Help Now