Home   MS-DOS Home   A-Z   NS Utilities   Command Syntax

LFNFOR

Home >> MS-DOS Reference >> Command Categories >> Batch File Commands >> LFNFOR

Batch File Commands

Batch File Commands


Summary
Description
Command Syntax
Comments
Supported DOS versions: MS-DOS 7+/Windows 9x
How easy to use? Hard
How safe to use? Very safe
How common? Fairly obscure
Internal or external command? Internal

Description

Enables/Disables Long file names when processing FOR commands.

Command Syntax

LFNFOR [ON | OFF]

Typing LFNFOR on its own will display the current setting.

Comments

This command is undocumented. It only works when Windows 9x is loaded in GUI mode.

LFNFOR must qualify as one of the most obscure commands around. It is used in conjunction with the FOR command. Given the following filenames:

Long Name 1.txt (= LONGNA~1.TXT)
Long Name 2.txt (= LONGNA~2.TXT)
Long Name 3.txt (= LONGNA~3.TXT)

If LFNFOR is set off then:

FOR %I IN (*.TXT) DO ECHO %I

will display

LONGNA~1.TXT
LONGNA~2.TXT
LONGNA~3.TXT

If it is set on then this will be displayed:

Long Name 1.txt
Long Name 2.txt
Long Name 3.txt

Home Home
MS-DOS MS-DOS Home
A - Z Index A - Z Index

Top of page
Summary
Description
Command Syntax
Comments




Top of page    Home    MS-DOS Home    NS Utilities
Copyright © 2005 Marcus Houlden  |  Copyright and Data Protection

Printed from the NukeSoft MS-DOS Reference. Copyright © 1995 - 2006 Marcus Houlden