Jump to content

DOS prompt command (long directory names)


Recommended Posts

Guest Don Culp
Posted

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

  • Replies 2
  • Created
  • Last Reply
Guest Pegasus \(MVP\)
Posted

Re: DOS prompt command (long directory names)

 

 

"Don Culp" <dculp@krell-engineering.com> wrote in message

news:e6qOMAy$HHA.5164@TK2MSFTNGP05.phx.gbl...

> 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.

Guest Nightowl
Posted

Re: DOS prompt command (long directory names)

 

Don Culp <dculp@krell-engineering.com> wrote on Mon, 24 Sep 2007:

>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>

 

--

Nightowl


×
×
  • Create New...