Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Short DOS names
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00179850
Message ID:
00179885
Vues:
21
>Is there a method to return the short DOS name (standard 8char.3char format) for a file or directory? I'm calling an old utility that can't accept long file names and need to convert the WIN95 long file name to the old DOS file name format.

Try:
LPARAMETER cPathToConvert
DECLARE INTEGER GetShortPathName IN Win32API ;
  STRING  @cLongPath, ;
  STRING  @cShortPathBuff, ;
  INTEGER nBuffSize
LOCAL cBuf, nBufSize, nShortSize
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