Announcement

Collapse
No announcement yet.

Send to desktop via script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Send to desktop via script

    How can i send a shortcut to the desktop via script. I have a policy which will install a new version of a software we are using. But the shortcuts on desktop and quick launch are created manully and need to be deleted and recreated.

  • #2
    Re: Send to desktop via script

    You can create a desktop shortcut file in the users profile:

    Code:
    On Error Resume Next
    strDesktop = WshShell.SpecialFolders("Desktop")
    set WshShell = WScript.CreateObject("WScript.Shell")
    Set objShell = CreateObject("WScript.Shell")
    Set objLink = objShell.CreateShortcut(StrDesktop & "yourshortuct.lnk")
    objLink.Description = "description"
    objLink.IconLocation = "iconlocation"
    objLink.TargetPath = "tagertpath"
    objLink.WindowStyle = 2
    objLink.WorkingDirectory = "workingdirectory"
    objLink.Save
    Or you could just simply copy the shortcut file (save to a location) to the desktop overwriting the existing shortcut file
    Last edited by themanwhowouldbeking; 25th October 2007, 15:54.
    MCSA 2000/2003

    Comment

    Working...
    X