Jump to content

Creating Shortcut to File whose filename is longer than 8 characters does not work


Recommended Posts

I've written a script to create a shortcut to a file (executable) that will reside on a USB memory stick using the function FileCreateShortcut(). The name of the file is 9 characters in length (not including the .exe extension) and he USB stick is designated drive E: (I have no control over this)

It is intended to run this script without the USB memory stick mounted on the target machine.

The script executes ok but when inspecting the properties of the shortcut the name of the target file has been truncated to 8 characters in length. For example a file whose name is 'onetwothreefour.exe' will be truncated to 'onetwoth.exe'. Subsequently Windows will look for the wrong file when the shortcut is double-clicked.

I noticed that if I do have a USB memory stick or USB-Drive mounted as drive E:, then the filename is NOT truncated. It appears that Windows is defaulting to the bad old DOS 8 character filename limit if E drive is not available.

Has anyone else come across this or know of a way around this problem?

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...