Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I get short name from long name ?
Message
From
12/08/1998 08:37:59
 
 
To
12/08/1998 06:50:25
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00125906
Message ID:
00125951
Views:
16
>Earlier we used to save files with more than 8+3 charecters for file name and extension. Now we can have long file names (enhanced file descreptions). If I give the long file name , I want the equilant short file name and vice versa.
>
>eg: when you type DIR command at DOS prompt, you get short and long file names.
>
>If I need to use any Windows APIs or DLLs, Pl give the names and functions to retrieve the fiel names.
>

Try:
LPARAMETER cPathToConvert
LOCAL cBuf, nBufSize, nShortSize
DECLARE INTEGER GetShortPathName IN Win32API ;
  STRING  @cLongPath, ;
  STRING  @cShortPathBuff, ;
  INTEGER nBuffSize
cBuf= space(511)
nBufSize = 511
nShortSize = GetShortPathName(cPathToConvert,@cBuf,@nBufSize)
IF nShortSize > 0
	RETURN LEFT(cBuf,nShortSize)
ELSE
	RETURN ''
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform