Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get short name from long name ?
Message
De
12/08/1998 08:37:59
 
 
À
12/08/1998 06:50:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00125906
Message ID:
00125951
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform