cmd.exe: display long directory name

G

George

I use cmd.exe quite a bit. I have some fairly deep paths to the
directories I work in, so I've truncated the command prompt.
Sometimes, I lose track of where I am. I'd like to make a batch file
that shows the current path, with full dirctory names (ie, not 8.3
form).

I can sort of do this with two .cmd's:

- sp.cmd
spp .\

- spp.cmd
echo %~p1

I suspect this can be done more neatly?

Thanks,
George
 
P

Pegasus \(MVP\)

George said:
I use cmd.exe quite a bit. I have some fairly deep paths to the
directories I work in, so I've truncated the command prompt.
Sometimes, I lose track of where I am. I'd like to make a batch file
that shows the current path, with full dirctory names (ie, not 8.3
form).

I can sort of do this with two .cmd's:

- sp.cmd
spp .\

- spp.cmd
echo %~p1

I suspect this can be done more neatly?

Thanks,
George

Here are a couple of alternatives:
echo %cd%
cd (no arguments)
 
G

George

I guess the problem is somewhere in my environment. I had tried those,
and they gave 8.3-type names. It turns out, that's only the case after
running a particular big Perl script that I need to use. God only
knows what that might be doing. So, thanks.
 
P

Pegasus \(MVP\)

George said:
I guess the problem is somewhere in my environment. I had tried those,
and they gave 8.3-type names. It turns out, that's only the case after
running a particular big Perl script that I need to use. God only
knows what that might be doing. So, thanks.

This always happens when you run a 16-bit application, and
never with a 32-bit app. Do you run a 16-bit version of Perl?
Does the script shell out to a 16-bit application?
 
G

George

Does the script shell out to a 16-bit application?

Yep - an old compiler. Is there a way to recover '32-bit' mode?
 
P

Pegasus \(MVP\)

George said:
Yep - an old compiler. Is there a way to recover '32-bit' mode?

You could do this:

@echo off
.. . .
.. . .
pushd "%cd%"
your16bit.exe
popd

Make sure your pushd/popd commands are paired, to
avoid a stack overflow.
 

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