We are about to carry out a data migration which limits our Pathnames+filename to 200 characters.
In order to maintain our data structure we intend to move folders that exceed the limit to a "Long Folders" directory leaving a shortcut behind at the original position.
The data will then be transfered to a read only server with an unknown drive specification. Hence we want to create the shortcuts with relative as well as absolute path references.
The other major problem is that I can only use standard library call as the system is locked down. Hence I cannot just import library files.
Where I have got to
The code below creates a shortcut with a relative path and absolute path correctly.
If the shortcut is activated before it is made read only, the path is resolved and once made read only and moved still works using the relative link information
As the number of these shorcuts could run into 1000's I need to automate this process
I have found a resolve method in the shell class and by using a library supplied at http://www.pacificdb.com.au/MVP/Download/SHELLLNK.TLB
I can use some fairly cumbersome code to call function but it appears to work. However, I cannot use it on a live system as it using a non standard library.
However, I am sure I can call it somehow from shell32.dll. Any suggestions or alternatives welcome. I can aure you I am just a humble user trying to get his data across in a usable form and this is not commercial.
Dim oShell As IWshShell_Class
Dim oShortcut As IWshShortcut_Class
Dim cShellLink As ShellLinkA
Dim cPersistFile As IPersistFile
Dim SShortcutName As String
Dim Fso As New FileSystemObject
Dim MyFile As File
Dim WshShell As Object
Set WshShell = CreateObject("WScript.Shell")