Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Short DOS names
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00179850
Message ID:
00179885
Views:
20
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform