Shell.CreateShortcut problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • leebos
    Indigo Rose Customer
    • Nov 2003
    • 141

    Shell.CreateShortcut problem

    I have a problem with the "target" file path being truncated after the 8th character in the second line of code below. The first is ok and they are identical except for the drive letter, which is a remote network drive.

    Does anyone have an idea as to why it is being truncated?

    Shell.CreateShortcut(icon_folder, icon_name, bpath..batchname, save, utsfolder, utsfolder.."\\wise.ico", 0, 7, nil);

    Shell.CreateShortcut(icon_folder, "WKS_"..icon_name, targetp, "", remote_utsfolder, remote_utsfolder.."\\wise.ico", 0, 7, nil);

    Thanks,
    Lee
  • Derek
    Indigo Rose Customer
    • May 2001
    • 1254

    #2
    What's the value of targetp? Have you tried using UNC instead?
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

    Comment

    • leebos
      Indigo Rose Customer
      • Nov 2003
      • 141

      #3
      Originally posted by Derek View Post
      What's the value of targetp? Have you tried using UNC instead?
      targetp is Z:\UTS07\TWICONS\CenRidLib\CenRidLib.bat

      UNC? please explain.

      I just found that if the remote drive is mapped, or it is an encrypted drive that is mounted it works ok. But if the remote drive is not available when the code is run the "b" is truncated from CenRidLib in both places.

      Could this be an AMS bug?

      Lee

      Comment

      • longedge
        Indigo Rose Customer
        • Aug 2003
        • 2496

        #4
        UNC (Universal Naming Convention) or a way to address a network resource in the format "\\servername\foldername\subfoldername\filenam e".

        FWIW I'd go further than Derek and say if you are addressing networked resources, then never never ever use drive names e.g. "Z:/foldername/filename".

        The way drives are mapped for one user will inevitably be different for someone else.

        If it's just a drive attached to your own machine and you are the only one who is going to use the application that's a different matter.

        p.s. - The forum is adding spaces again!! I didn't put a space in "filename" at the end of the first sentence.

        Comment

        • leebos
          Indigo Rose Customer
          • Nov 2003
          • 141

          #5
          Thanks longedge. At the point I'm building this app the server name is unknown, and will vary. However, every workstation that the shortcut is to be used on will have drive Z mapped to the correct server.

          Lee

          Comment

          • Derek
            Indigo Rose Customer
            • May 2001
            • 1254

            #6
            I just tested this and had the same problem. The 'b' is missing in both places when specifying an unavailable mapped drive.
            UNC did work, however. Tho if the server name is unknown/variable it could prove a little difficult!
            -
            = Derek
            ["All glory comes from daring to begin" - fortune cookie]

            Comment

            • longedge
              Indigo Rose Customer
              • Aug 2003
              • 2496

              #7
              Originally posted by leebos View Post
              Thanks longedge. At the point I'm building this app the server name is unknown, and will vary. However, every workstation that the shortcut is to be used on will have drive Z mapped to the correct server.

              Lee
              As long as you are aware of the potential problem that's fine. In our organisation I would only ever use fully qualified UNC's. Drive mapping is very useful but can sometimes be a double edged sword

              Comment

              • leebos
                Indigo Rose Customer
                • Nov 2003
                • 141

                #8
                Thanks Derek, I posted it as a bug in the suggestions/bugs forum. Possibly IR can fix it.

                Lee

                Comment

                Working...
                X