Well if I had to solve the problem I wouldn't like to undergo the process of programming a fuction that converts a full path to 8 characters.
I would suggest a more simpler and faster solution. Write the file that you are passing to the old dos programm to a path that already obeys the 8 characters restriction, e.g. c:\temp\data.txt
You dont need any conversion then and the old dos program can be started with the same parameter every time.
If this solution does not work for you, you may also have a look at the MSDOS command "Subst". Just use the path you would like to use but use a file name that follows the 8 chars restriction. Use the MSDOS Subst function to create a new drive letter for the full path. To clarify what I mean, just a small example:
Full path to the file : "c:\averylongdirectoryname\withsomesubfoldersthathavealongnametoo\data.txt"
subst h: "c:\averylongdirectoryname\withsomesubfoldersthathavealongnametoo"
h:
type h:\data.txt |more
Enter your message below
Sign in or Join us (it's free).