Announcement

Collapse
No announcement yet.

Creating a shortcut on the desktop with a specific Icon

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

  • Creating a shortcut on the desktop with a specific Icon

    I am using the following script:
    I need to have a specific ICON for the shortcut.
    The icon file will be located in the same folder as the script.
    How can I change my egsisting script to do this?
    Thanks
    Here is the script I am using now:

    ' Create a ShortCut to the ExecuTrain Libraries on desktop:
    'Create a WshShell Object
    Set WshShell = Wscript.CreateObject("Wscript.Shell")
    'Create a WshShortcut Object
    strDesktop = WshShell.SpecialFolders("Desktop")
    Set oURLLink = WshShell.CreateShortcut(strDesktop + "\www.microsoft.com.URL")
    'Set the Tragte URL
    oURLLink.TargetPath = "http://www.microsoft.com/"
    'Save the shortcut
    oURLLink.Save
    ________
    Sexdollxx
    Last edited by meterman; 16th August 2011, 12:16.

  • #2
    Re: Creating a shortcut on the desktop with a specific Icon

    Just underneath the following line:

    oURLLink.TargetPath = "http://www.microsoft.com/"

    Place the following:

    oURLLink.IconLocation = "A_FileName_Containing_The_Icon, Integer_Position_Of_Icon"

    where A_FileName_Containing_The_Icon is the name of the file containing the icon (including full path or UNC)

    and where Integer_Position_Of_Icon is the number of the icon of the file. THe numbering starts at 0 (zero).

    Example 1: oURLLink.IconLocation = "SHELL32.dll, 18"
    Example 2: oURLLink.IconLocation = "C:\Windows\System32\SHELL32.dll, 98"

    Hope this helps!

    Comment


    • #3
      Re: Creating a shortcut on the desktop with a specific Icon

      well, hmm
      The icon is a .ico file and the directory it is in may vary, but it will alway's reside in the same directory as the script. is there some way to refer to the current directory the script is in for the path of the .ico file? Also this number you are refering to. will this exsist in a .ico file? just the .dll files that contain multiple icons right? the script is a logon script for a domain applied to a specific OU.

      Thnaks
      ________
      RobinXXX
      Last edited by meterman; 16th August 2011, 12:17.

      Comment


      • #4
        Re: Creating a shortcut on the desktop with a specific Icon

        How many times are you going to post the same question? This is the THIRD thread about this same question!!

        http://forums.petri.com/showthread.php?t=6808
        1 1 was a racehorse.
        2 2 was 1 2.
        1 1 1 1 race 1 day,
        2 2 1 1 2

        Comment


        • #5
          Re: Creating a shortcut on the desktop with a specific Icon

          I am just trying to get an answer, sorry to fill up the forum
          ________
          California medical marijuana
          Last edited by meterman; 16th August 2011, 12:17.

          Comment

          Working...
          X