Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LFN - what makes DIR in FPW2.6a and in Win XP using bat-file

Status
Not open for further replies.

stesvet1

Technical User
Sep 23, 2006
22
[1] If I launch DIR command from FPW26.a command window or prg, the result are inly 8.3 file names in English

Example: Looking for ppt-files in Document and settings
a) DIR C:/xxxx/*.ppt /s /a:-d >result.txt
b) Directory of C:\DOCUME~1\XXXXXXXXXXXXXXX
ELEARN~1 PPT 756736 13.12.06 22.32

[2] If I launch the same DIR command but from Windows XP prompt-line from bat file (e.g. search.bat), the results are Long Files Name in Slovak language

a) the same DIR C:/xxxx/*.ppt /s /a:-d >result.txt launching via the search.bat
b) output in Slovak language in Windows XP: Výpis adresára C:\DOCUME~1\XXXXXXXXXXXXXXX

15.12.2008 01:21 289 792 chemicka_toxikologia.ppt
17.08.2009 00:37 544 256 pred.7.VL.ZS-mykobakt..ppt
24.06.2009 01:36 969 216 EnergyFlow.ppt
06.05.2009 19:01 1 048 064 PHOTOSYNTHESIS.ppt

[3] Please, try in your Windows XP national environment if DIR command gives Long File Names or 8.3 file names

Try e.g. DIR C:/*.ppt /s /a:-d >result.txt


Note: If yes, then Long File Names can you obtain also in FPW2.6a but not directly! According your answers I will write you how can you obtain Long File Names List on your computer from foxpro environment

 
At first I thought you were confusing the behaviour of the DOS DIR command in the batch file with the Fox DIR command but then I found that there was a difference. I wrote a batch file:
Code:
dir D:\Admin\*.* > c:\test.txt
When I called this from FPW 26 with [TT]! c:\test.bat[/TT] it gave me short file names. When I called it with [TT]!/N c:\test.bat[/TT] I got long file names.

It must be something to do with the command interpreter being called so I tried a batch file that would give me the DOS version:
Code:
ver() > c:\test.txt
This gives me "Microsoft Windows XP [Version 5.1.2600]" if I run it with [TT]!/N[/TT] but gives an error message when run with a plain [TT]![/TT] which suggests that it's invoking an earlier DOS which lacks the VER command.

An interesting interlude for a coffee break but I'm not sure if it gets me anywhere useful.

Geoff Franklin
 
Then you can use Explorer from Wwindows XP for managing your files (It is some times very useful)!

Example:
1. I found this file on USB-key G:\
* Engineering_ocupational_Health.pdf

2. Now, if I type in FPW26.a command window:
run /n explorer "Engineering_ocupational_Health.pdf"
then Explorer start it directly!

Thus you can, e.g. place your subfolders item into memo-fields and start it systematicaly (making your own system).

Or basicaly if you use just text editor of FPW26.a you need not always programming your paths. If you have in subfolder e.g. 15326 files you can find it more quickly using your eyes and text editor.




 
Lauching a DOS command with '!' uses FoxPro's own custom DOS eg version 5.

If you want to run the XP version of something like DIR, with long filename format, use

! cmd /c DIR /? > CMDHELP.TXT

XP's cmd.com uses the /c parameter to pass the command you're trying to run.

-MT
 
Thank you,
i did not know it (! cmd /c DIR /? > CMDHELP.TXT).

Till now I solved it by writing the DIR command into MEMO-field, then copying MEMO to bat-file and then starting the bat-file.

Now, I am shure it doesn't depend on any national environment!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top