Solved

Internet Shortcut placed on all users desktop

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SPLUNK REST  API call to Splunk to create and index? 2 120
Problem to echo 6 97
Change the background and font colors in Notepad++ 5 86
exchange ,script 10 44
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to count occurrences of each item in an array.

772 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