Long directory listing?

  • Thread starter Thread starter Ben Samuals
  • Start date Start date
B

Ben Samuals

I work with some file systems that are really deep as far as directories are
concerned. for ex.

d:\test\122\123\1\test1\... on and on. Working with these long dirs makes
working within a cmd prompt tough moving everything to the next line. Is
there a way to keep this line short so it would read:

d:..\test1


thx,...
 
Ben Samuals said:
I work with some file systems that are really deep as far as directories
are concerned. for ex.

d:\test\122\123\1\test1\... on and on. Working with these long dirs makes
working within a cmd prompt tough moving everything to the next line. Is
there a way to keep this line short so it would read:

d:..\test1

Hi Ben,

I am not sure of an easy solution using cmd.exe. One idea off the top of
my head is to use a single-character prompt, e.g. prompt $g. You can always
see which directory you're in by just entering 'cd'.

Bill
 
In said:
I work with some file systems that are really deep as far as
directories are concerned. for ex.

d:\test\122\123\1\test1\... on and on. Working with these long
dirs makes working within a cmd prompt tough moving everything to
the next line. Is there a way to keep this line short so it would
read:

d:..\test1

No, but try set prompt=$p$g$_
 
Try using subst command to substitute a drive letter to your long path.
Something like

subst b: "d:\test\122\123\1\test1"

Now you should be able to access a file say
"d:\test\122\123\1\test1\SomeFile.txt" as "b:SomeFile.txt"
 
I work with some file systems that are really deep as far as directories are
concerned. for ex.

d:\test\122\123\1\test1\... on and on. Working with these long dirs makes
working within a cmd prompt tough moving everything to the next line. Is
there a way to keep this line short so it would read:

d:..\test1

I'm not sure about CMD's capabilities in this regard; I use 4NT where
you can use the token $w in a prompt which shows the shortened current
directory (see: <http://jpsoft.com/help/prompt.htm>). In you case, it
would produce: D:\...\test1

Additionally, 4NT has an environment variable TITLEPROMPT the content of
which is displayed in the command console's window title; TITLEPROMPT
accepts the same tokens as PROMPT.

Or you can construct prompts with 4NT's EXEC[] function, which is what I
use:
SET Prompt=`%@EXEC[@TITLE 4NT in %@LFN[%_cwd]]$$ `
which puts the full current directory in the console's window title and
a single dollar sign + space as the command line prompt (apologies to
VMS).
 
Ben Samuals said:
I work with some file systems that are really deep as far as directories are
concerned. for ex.

d:\test\122\123\1\test1\... on and on. Working with these long dirs makes
working within a cmd prompt tough moving everything to the next line. Is
there a way to keep this line short so it would read:

d:..\test1
In addition to the previous tips,
expand the window size. Working on a notebook with 1024*768 screen res.,
my cmd window has a size of 120*60 characters using a rasterfont of 8*16
Create a shortcut with these changed settings or use "mode x,y"

To see a very long path in a structured manner, you may use this batch.
I named it ~.cmd for shortness, If you don't like this cause of the unix
home path, maybe ICD.cmd for indented CD is an alternative. It is
limited to ten folderlevels but may be expanded.

==screen==copy=========================================================
E:\Dokumente und Einstellungen\tackemat\Eigene Dateien\Eigene Bilder>~
E:
-\Dokumente und Einstellungen
--\tackemat
---\Eigene Dateien
----\Eigene Bilder

E:\Dokumente und Einstellungen\tackemat\Eigene Dateien\Eigene Bilder>
==screen==copy=========================================================

::~.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off & setlocal
set /A Count=0 & set Pref=----------
call :CD "%CD%"
goto :eof
:CD
echo/%~d1
for /F "tokens=1-10 delims=\" %%A in ("%~pnx1") do (
call :Loop "%%A" "%%B" "%%C" "%%D" "%%E" "%%F" "%%G" "%%H" "%%I" "%%J")
goto :eof
:Loop
set /A Count+=1
if "%~1"=="" goto :eof
call echo/%%Pref:~0,%Count%%%\%~1
shift
goto :Loop
::~.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
Back
Top