>>
>>The short file name doesn't exist until the file is written to the disk. If the file name doesn't exist yet, there's no short path to return.
>
>You must have missed the code that I supplied. I hard code the path name. Let me show you again.
>
>declare integer GetShortPathName in Win32API string, string, integer
>
>lcLongFile = "c:\program files\somefolder\my file name.doc"
>lcBuffer = SPACE(100)
>lnBufferSize = 101
>lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, lnBufferSize)
>
>MessageBox(alltrim(str(lnShortPathLen))+[ | ]+alltrim(lcBuffer),16,[Short Path Name])
>
>return
>
>You can't get any simpler then this. Please, please try this out on your system and let me know if it works. The long file name is hard coded, so it does exist. lcLongFile = "c:\program files\somefolder\my file name.doc". Even this simple code will not work for me.
>
>DJ :o)
Donald,
I have (and did) test it prior to the original post. The following was returned when I selected the VFP 7.0 executable from C:\Program Files\Microsoft Visual FoxPro 7 folder
C:\PROGRA~1\MIE6EC~1\VFP7.EXE
When I hardcode "C:\Program Files\Microsoft Visual FoxPro 7\Garbonzo Beans.txt", which is a file that does not exist on the drive, the function returns 0, and the buffer is empty. IOW, the file must have a physical presence on the disk.
George
Ubi caritas et amor, deus ibi est