DOS prompt command (long directory names)

D

Don Culp

In a command window, I use the following prompt command:

prompt $P$_$G

which gives a prompt something like:

C:\mydirectory1\mydirectory2

However, after running certain DOS programs from this command window and
then exiting these programs, each long directory name in the prompt is
shortened to a maximum of 8 characters:

C:\mydire~1\mydire~2

Is there an easy way to restore the original prompt with its long directory
names? I need a method that will work on any path with long directory names,
since I frequently move around among such directories within the command
window. (I know that I can type "cd C:\mydirectory1\mydirectory2" but this
is not convenient, especially when the path is long. Also, sometimes I
cannot deduce the full path name from the shortened version.)

Thanks,
Don Culp
 
P

Pegasus \(MVP\)

Don Culp said:
In a command window, I use the following prompt command:

prompt $P$_$G

which gives a prompt something like:

C:\mydirectory1\mydirectory2

However, after running certain DOS programs from this command window and
then exiting these programs, each long directory name in the prompt is
shortened to a maximum of 8 characters:

C:\mydire~1\mydire~2

Is there an easy way to restore the original prompt with its long
directory
names? I need a method that will work on any path with long directory
names,
since I frequently move around among such directories within the command
window. (I know that I can type "cd C:\mydirectory1\mydirectory2" but this
is not convenient, especially when the path is long. Also, sometimes I
cannot deduce the full path name from the shortened version.)

Thanks,
Don Culp

The problem occurs because the programs you run are
16-bit programs which cannot handle LFNs. I am not
aware of any method to restore the LFN notation except
for this work-around. It works like so:
- Create the batch file LFN.bat in c:\Windows.
- Put the following lines inside:
@echo off
pushd "%cd%"
%1 %2 %3 %4 %5
popd
- Save & close the file.
- Instead of invoking your 16-bit programs directly, invoke them
like so. I'm using fastopen.exe as an example.
LFN fastopen.exe parm1 parm2 etc.
 
N

Nightowl

Don Culp said:
Is there an easy way to restore the original prompt with its long directory
names? I need a method that will work on any path with long directory names,
since I frequently move around among such directories within the command
window. (I know that I can type "cd C:\mydirectory1\mydirectory2" but this
is not convenient, especially when the path is long. Also, sometimes I
cannot deduce the full path name from the shortened version.)

Hi Don

Do you have Command's completion character and path completion character
functions enabled on your system? If you don't, they enable you to type
just the beginning of a path and then cycle through the matching names.
I'm wondering if that might help here.

I don't run DOS programs so I may not have exactly duplicated your
situation, but I tried an experiment (details below) and it did restore
the long-name prompt for me. Your problem might be different, of course,
but it could be worth a try?

Here's a link explaining the completion keys and how to enable them:
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=568

Here's a blow-by-blow description of what I tried:

Opened a Command window with Start | Run > cmd
Navigated to C:\Documents and Settings
At this point the prompt was C:\Documents and Settings>

Then I ran Command.com. The prompt then looked like this:
C:\DOCUME~1>. I typed "exit" to end the command.com session. The prompt
still showed as: C:\DOCUME~1>

I typed: cd c:\do (the beginning of the folder name) then pressed my
path completion key. The command line changed to:
C:\DOCUME~1>cd "c:\Documents and Settings".
After pressing Enter the prompt was back to C:\Documents and Settings>
 

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