cmd prompt

G

Guest

The cmd prompt ($p$g) defaults to displaying long filenames but may switch to
8.3 format for no obvious reason. I find this very irritating. Does anyone
know what controls this behavior or how to force the prompt to use LFN only?
This also affects the ChDir command when used to display the current
directory.
 
T

Terry

On 1/28/2005 2:57 PM On a whim, John pounded out on the keyboard
The cmd prompt ($p$g) defaults to displaying long filenames but may switch to
8.3 format for no obvious reason. I find this very irritating. Does anyone
know what controls this behavior or how to force the prompt to use LFN only?
This also affects the ChDir command when used to display the current
directory.

If you use "command" (16-bit) you will get the 8.3 by default. But if
you use "cmd" (32-bit) you should get long file names. Are you sure
you're not typing "command" from within a "cmd" window? This will cause
the behavior you describe.


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
J

Jon Cosby

John said:
The cmd prompt ($p$g) defaults to displaying long filenames but may switch
to
8.3 format for no obvious reason. I find this very irritating. Does
anyone
know what controls this behavior or how to force the prompt to use LFN
only?
This also affects the ChDir command when used to display the current
directory.

Enclose the path/filename in quotes.

Jon Cosby
 
P

Pegasus \(MVP\)

John said:
The cmd prompt ($p$g) defaults to displaying long filenames but may switch to
8.3 format for no obvious reason. I find this very irritating. Does anyone
know what controls this behavior or how to force the prompt to use LFN only?
This also affects the ChDir command when used to display the current
directory.

Using command.com will swith to SFNs (as Terry observerd). The
same happens under cmd.exe after you have executed a 16-bit
command, e.g. debug.exe or edit.com. Avoid 16-bit programs;
use their 32-bit equivalents instead (e.g. notepad.exe instead of
edit.com).
 
G

Guest

Ah ha! So once cmd.exe has seen a 16 bit app (like a legacy DOS program in
my case) it reverts to 8.3. Is there any way to get the cmd prompt back to
LFN's? Mostly a cosmetic issue but not entirely. Thanks for the info.
 
T

Terry

On 1/28/2005 4:13 PM On a whim, John pounded out on the keyboard
Ah ha! So once cmd.exe has seen a 16 bit app (like a legacy DOS program in
my case) it reverts to 8.3. Is there any way to get the cmd prompt back to
LFN's? Mostly a cosmetic issue but not entirely. Thanks for the info.

:

It doesn't appear to be, except for launching a new instance of it.


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
P

Pegasus \(MVP\)

You could create a batch file LFN.bat with the following code.
It's fairly slow but it shoud work. Remove the line numbers
before running the file.

Line1 @echo off
Line2 rem Changes the current prompt to LFN
Line3 set org=%cd%
Line4 cd \
Line5 call :Sub %org%
Line6 goto :eof
Line7
Line8 :Sub
Line9 set folder=%*
Line10 for /F "tokens=1* delims=\" %%a in ('echo %folder%') do (
Line11 call :SubSub %%a %%b
Line12 if not "%%b"=="" call :Sub =%%b
Line13 )
Line14 goto :eof
Line15
Line16 :SubSub
Line17 set temp=
Line18 for /F "tokens=5*" %%x in ('dir /ad /x ^| find /i "%1"') do set
temp=%%x
Line19 if "%temp%"=="" (
Line20 for /F "tokens=4*" %%x in ('dir /ad /x ^| find /i "%1"') do cd
"%%x"
Line21 ) else (
Line22 for /F "tokens=5*" %%x in ('dir /ad /x ^| find /i "%1"') do cd "%%x
%%y"
Line23 )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top