Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Long Filename to short filename~
Message
De
05/11/1998 06:15:59
 
 
À
05/11/1998 03:23:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00154708
Message ID:
00154732
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform