How to change LongName path to shortName path?
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
How to change LongName path to shortName path?
Hi All,
Ex. c:\progam files\aaa" --> c:\program~1\aaa
Ex. c:\progam files\aaa" --> c:\program~1\aaa
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- Enrico Maria Giordano
- Posts: 8761
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
Re: How to change LongName path to shortName path?
Hi EMG,
Thanks. I will try it.
But I got Empty.
Ex.
Lfn2Sfn( curdir() )
OS: XP
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
- Enrico Maria Giordano
- Posts: 8761
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: How to change LongName path to shortName path?
The following sample works fine here:
EMG
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
MEMOWRIT( "This is a long name", "Test" )
? LFN2SFN( "This is a long name" )
RETURN NIL
EMG
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
Re: How to change LongName path to shortName path?
Antonio Linares wrote:Richard,
Is CurDir() returning a long filename ?
Yes, c:\program files
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- richard-service
- Posts: 808
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Has thanked: 2 times
- Contact:
Re: How to change LongName path to shortName path?
Enrico Maria Giordano wrote:The following sample works fine here:Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
MEMOWRIT( "This is a long name", "Test" )
? LFN2SFN( "This is a long name" )
RETURN NIL
EMG
? LFN2SFN( "This is a long name" ) --> Empty
Test FWH801
Best Regards,
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
Richard
Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: How to change LongName path to shortName path?
Richard,
You need to have a file or a folder with that name in order to get LFN2SFN() working.
It is a Windows API requirement.
You need to have a file or a folder with that name in order to get LFN2SFN() working.
It is a Windows API requirement.
- Enrico Maria Giordano
- Posts: 8761
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: How to change LongName path to shortName path?
richard-service wrote:? LFN2SFN( "This is a long name" ) --> Empty
Test FWH801
Are you using my sample without changes? If yes, do you want my EXE to test there? I'm using latest FWH.
EMG
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: How to change LongName path to shortName path?
Enrico,
You example works fine because you are previously creating a longname file.
If Silvio does not create it, as he should do, then the Windows API will not work
You example works fine because you are previously creating a longname file.
If Silvio does not create it, as he should do, then the Windows API will not work
