Solved

Internet Shortcut placed on all users desktop

Posted on 2011-02-16
5
368 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:Huseyin KAHRAMAN
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:Huseyin KAHRAMAN
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:Huseyin KAHRAMAN
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:Huseyin KAHRAMAN
ID: 34909763
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

749 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