Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Is there a way to see current directories in all drives?

May
313
6
If I type "cd" or "cdd", without parameters, it shows the path of the current directory in the current drive. For example, in C: drive I am in "C:\abc". In D: drive I am in "D:\xyz". If I am in C: drive, I would like to be able to know that if I type "D:" I will end in "D:\xyz". Is it possible, maybe without changing drive? Or I have to ask for the wish list in a future release?

Thank You very much and regards

Rodolfo Giovanninetti
 
You can use the @CWD Function, e.g.
Code:
(system)  C:\...\TCCLE13x64 >d:
 
(data1)  D:\ >cd io
 
(data1)  D:\IO >C:\Program Files\JPSoft\TCCLE13x64\
 
(system)  C:\...\TCCLE13x64 >for %d in ( %_drives ) if %@ready[%d] eq 1 if %@removable[%d] ne 1 echo %@cwd[%d]
 
C:\Program Files\JPSoft\TCCLE13x64
D:\IO
E:\
F:\
 
Slightly simpler to use %_ready:

alias allcwd=`for %d in (%_ready) echo %d %@cwd[%d]`

Tested! Report includes all currently accessible drives, local and mapped network drives, including USB sticks, CD/DVD, etc.
 
If I type "cd" or "cdd", without parameters, it shows the path of the current directory in the current drive. For example, in C: drive I am in "C:\abc". In D: drive I am in "D:\xyz". If I am in C: drive, I would like to be able to know that if I type "D:" I will end in "D:\xyz". Is it possible, maybe without changing drive? Or I have to ask for the wish list in a future release?

What happens if you type CDD /A ?
 
What happens if you type CDD /A ?
Code:
(system)  C:\...\TCCLE13x64 >cdd /a
C:\Program Files\JPSoft\TCCLE13x64
D:\IO
E:\
F:\
every day at least one new lesson learned :)

%_ready : I know this one but it doesn't work in LE and it shows me CD/DVD what I don't want.
 
you're right.
 
I wanted to clarify one thing about this topic -- in Windows, you do not have a current directory on any other drive! There is a single "current directory", and it's the one you're in.

What TCC (and CMD) do is fudge this a bit (originally to provide some backwards compatibility to DOS batch files). TCC will create (and update) a hidden environment variable that contains the CWD for the current drive. When you switch to another drive, TCC will create a hidden variable containing the CWD for that drive. HOWEVER (it's a big however!) Windows neither knows nor cares about these variables, so when you run another app, it will start over with a single current directory. (There are a few apps that will look for the hidden environment variables, but you certainly can't count on it.)
 
I wanted to clarify one thing about this topic -- in Windows, you do not have a current directory on any other drive! There is a single "current directory", and it's the one you're in.

What TCC (and CMD) do is fudge this a bit (originally to provide some backwards compatibility to DOS batch files). TCC will create (and update) a hidden environment variable that contains the CWD for the current drive. When you switch to another drive, TCC will create a hidden variable containing the CWD for that drive. HOWEVER (it's a big however!) Windows neither knows nor cares about these variables, so when you run another app, it will start over with a single current directory. (There are a few apps that will look for the hidden environment variables, but you certainly can't count on it.)
Don't modern versions of Windows still keep track of the hidden environment variables like "=C:".
 
Slightly simpler to use %_ready:

alias allcwd=`for %d in (%_ready) echo %d %@cwd[%d]`

Tested! Report includes all currently accessible drives, local and mapped network drives, including USB sticks, CD/DVD, etc.

I prefer my (slightly different) version:

Code:
for %A in (%_ready) do echo %@format[-12,%@label[%A]] %@cwds[%A]

I've mentioned before in another thread I have a "colorful" version of this as well.
 
I wanted to clarify one thing about this topic -- in Windows, you do not have a current directory on any other drive! There is a single "current directory", and it's the one you're in.

I don't understand. In TCC you can do this:

Code:
[D:\Y\Y]ver /R

TCC  13.03.47   Windows XP [Version 5.1.2600]
TCC Build 47   Windows XP Build 2600  Service Pack 3
Registered to Miguel Farah
 
[D:\Y\Y]cdd /A
C:\TEMP\XX
D:\Y\Y
F:\
M:\fotos_de_Alberto\20090813
N:\

[D:\Y\Y]copy M:IMG_0002.JPG C:
M:\fotos_de_Alberto\20090813\IMG_0002.JPG => C:\TEMP\XX\IMG_0002.JPG
     1 archivo copiado

[D:\Y\Y]

While in CMD.EXE you can do the same:

Code:
Microsoft Windows XP [Versión 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Miguel>cd \TEMP\XX

C:\TEMP\XX>M:

M:\>cd fotos_de_Alberto\20090813

M:\fotos_de_Alberto\20090813>D:

D:\>cd Y\Y

D:\Y\Y>copy M:IMG_0003.JPG C:
        1 archivos copiados.

D:\Y\Y>dir C:
 El volumen de la unidad C es ARMENGOL.160
 El número de serie del volumen es: B024-7079

 Directorio de C:\TEMP\XX

10/04/2012  21:20    <DIR>          .
10/04/2012  21:20    <DIR>          ..
13/08/2009  16:26           111.872 IMG_0002.JPG
13/08/2009  16:26            93.696 IMG_0003.JPG
               2 archivos        205.568 bytes
               2 dirs  92.089.872.384 bytes libres

D:\Y\Y>

Which means both TCC and CMD handle a "current directory" for each drive. Or are we talking about something similiar, but not exactly the same?
 

Similar threads

Back
Top