Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Long Filename to short filename~
Message
From
05/11/1998 06:15:59
 
 
To
05/11/1998 03:23:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00154708
Message ID:
00154732
Views:
18
>Hi,
>
>I like to know how do we change the long path name and filename obtain from the GETFILE() into the DOS short form name ? I had problem opening the file in folder with long name like
>
>From
>
> USE C:\My Installation\Report
>
>TO
>
> USE C:\Myinst~1\Report
>

There's a Win32 API call to do this:
DECLARE INTEGER GetShortPathName IN Win32API ;
  STRING  @cLongPath, ;
  STRING  @cShortPathBuff, ;
  INTEGER nBuffSize

cBuf= space(511)
nBufSize = 511
nShortSize = GetShortPathName(cPathToConvert,@cBuf,@nBufSize)
IF nShortSize > 0
        * It worked
	? LEFT(cBuf,nShortSize)
ELSE
	*  It failed
ENDIF
>
>
>Any help or advise is very much appreciated. Thank you.
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
Reply
Map
View

Click here to load this message in the networking platform