Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    WshShell.CreateShortcut

    Does anyone know why this vbs code halts at the
    oShellLink.FullName parameter??

    I thought the FullName parameter could be used to specifiy where the created shortcut is saved to (by the oShellLink.Save parameter)??

    **********************
    Set WshShell = Wscript.CreateObject("Wscript.Shell")

    Set oShellLink = WshShell.CreateShortcut("Pegasus Mail.lnk")
    oShellLink.TargetPath = "P:Pegasuswinpm-32.exe"
    oShellLink.FullName = "C:WindowsDesktop"
    oShellLink.Save
    **************************

    Thanks in advance,

    Ade

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: WshShell.CreateShortcut

    I would have expected FullName to want the file name as well such as
    "C:WindowsDesktopPegasus Mail.lnk"
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WshShell.CreateShortcut

    Thanks for responding. Unfortuantly, your suggestion produces the same error...

    "Wrong number of arguments or invalid property assignment: 'oShellLink.FullName'".

    Any further ideas out there?

    Thanks again,

    Ade

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WshShell.CreateShortcut

    Solved it via Microsoft Supprt search...

    Ignore the 'FullName' parameter, and specify the target location for the shortcut when setting the 'WshShell.CreateShortcut' object. E.g.

    *******
    Set WshShell = Wscript.CreateObject("Wscript.Shell")
    Set oShellLink = WshShell.CreateShortcut("C:WindowsDesktopPegasus Mail.lnk")

    oShellLink.TargetPath = "P:Pegasuswinpm-32.exe"
    oShellLink.Save

    Set oShellLink = Nothing
    *******

    These two articles at Microsoft Support may be useful to others:

    Q242297

    Regards and Thanks,

    Ade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •