>This is a good one.
>
>In VFP 7 when you used Getdir() it would return a DOS compliant folder name something like C:\DOCUME~1\MARK\LOCALS~1\TEMP
>
>In 9 if the original directory name is DOS compliant it will use ~ and stuff until you go to the root, then it will return the full folder name with spaces and stuff.
>
>I have an application that was written in 7 or earlier, there are quite a few places where I will have to go and put quotes around variables.
>
>I would prefer not to do this. Do y’all know of a way to get a DOS compliant folder name from one with the spaces and stuff, and vice versa.
>
>For example:
>C:\Program Files\ApplicationDir to c:\Progra~1\Applic~1 and back.
>
>I'm just guessing on how the translation is actually done.
>
>TIA
? GetShort(getfile())
function GetShort
lparameters cFileName
declare integer GetShortPathName in Win32API ;
string @lpszLongPath, ;
string @lpszShortPath, ;
integer cchBuffer
lpszShortPath = space(len(cFileName))
lnPathlen = GetShortPathName(@cFileName, @lpszShortPath, len(cFileName))
if lnPathlen > 0
return substr(lpszShortPath, 1, lnPathLen)
endif
return ""
However you don't need it.
lcFile = getfile()
Cetin