Undocumted CHDIR/CD Feature

Undocumted CHDIR/CD Feature

Post by Christian Lawso » Thu, 24 Oct 2002 04:16:18



You have to have the windows 2000 resource kit or support tools for this to
work, forgot which one.



> It works for me. I have been using this "undocumented" feature for many
> years now!

> -Ajay





> > Hi,

> > by accident I found out that, for example

> >   cd a*

> > changes to a directory that name begins with an "a" (or "A"). If there
> > are multiple matching directories, CD changes to the first match.

> Am I doing wrong?

> ====================================================
> d:\data\bat\help>ver

> Microsoft Windows 2000 [Version 5.00.2195]

> d:\data\bat\help>dir c* /ad
>  Volume in drive D is Data
>  Volume Serial Number is 549E-D90B

>  Directory of d:\data\bat\help

> 15/03/02  08:19         <DIR>          cal
> 07/03/02  14:17         <DIR>          cmdproc
> 18/05/02  12:33         <DIR>          comma
> 18/03/02  04:46         <DIR>          cx
>                0 File(s)              0 bytes
>                4 Dir(s)   5,354,176,512 bytes free

> d:\data\bat\help>cd c*
> The directory name is invalid.

> d:\data\bat\help>chdir c*
> The directory name is invalid.
> =======================================================
> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Thu, 24 Oct 2002 04:26:56


See my post below for the explanation :-)


Quote:

> I've seen this work on some machines and not work on others.  I've never
> taken the time to figure out why, since I use the command completion
> characters instead.  In fact, maybe command completion characters being
> enabled/disabled has something to do with it.


 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Thu, 24 Oct 2002 04:20:24


Not actually wrong, it's the pattern matching that's *ing you up :-)

If you have, as example, a file named
snurgle.txt
and a directory named
Snork
in the current dir, then CD S* returns the "The directory name is invalid."
message, as does CD SN*.
However:
CD SNO*
*does* work, as the parser can now determine you're not trying to CD to a
filename.  Do you see what's happening?

This behaviour has been around since NT 4, btw.  I can't recall if it was
there in 3.1/3.5x - too long ago now ;-)



Quote:> > Hi,

> > by accident I found out that, for example

> >   cd a*

> > changes to a directory that name begins with an "a" (or "A"). If there
> > are multiple matching directories, CD changes to the first match.

> Am I doing wrong?

> ====================================================
> d:\data\bat\help>ver

> Microsoft Windows 2000 [Version 5.00.2195]

> d:\data\bat\help>dir c* /ad
>  Volume in drive D is Data
>  Volume Serial Number is 549E-D90B

>  Directory of d:\data\bat\help

> 15/03/02  08:19         <DIR>          cal
> 07/03/02  14:17         <DIR>          cmdproc
> 18/05/02  12:33         <DIR>          comma
> 18/03/02  04:46         <DIR>          cx
>                0 File(s)              0 bytes
>                4 Dir(s)   5,354,176,512 bytes free

> d:\data\bat\help>cd c*
> The directory name is invalid.

> d:\data\bat\help>chdir c*
> The directory name is invalid.
> =======================================================
> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Ajay K. Agrawa » Thu, 24 Oct 2002 04:19:35


I don't believe this to be the case.

-Ajay


You have to have the windows 2000 resource kit or support tools for this to
work, forgot which one.



> It works for me. I have been using this "undocumented" feature for many
> years now!

> -Ajay





> > Hi,

> > by accident I found out that, for example

> >   cd a*

> > changes to a directory that name begins with an "a" (or "A"). If there
> > are multiple matching directories, CD changes to the first match.

> Am I doing wrong?

> ====================================================
> d:\data\bat\help>ver

> Microsoft Windows 2000 [Version 5.00.2195]

> d:\data\bat\help>dir c* /ad
>  Volume in drive D is Data
>  Volume Serial Number is 549E-D90B

>  Directory of d:\data\bat\help

> 15/03/02  08:19         <DIR>          cal
> 07/03/02  14:17         <DIR>          cmdproc
> 18/05/02  12:33         <DIR>          comma
> 18/03/02  04:46         <DIR>          cx
>                0 File(s)              0 bytes
>                4 Dir(s)   5,354,176,512 bytes free

> d:\data\bat\help>cd c*
> The directory name is invalid.

> d:\data\bat\help>chdir c*
> The directory name is invalid.
> =======================================================
> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Marty Lis » Thu, 24 Oct 2002 04:21:40


I've seen this work on some machines and not work on others.  I've never
taken the time to figure out why, since I use the command completion
characters instead.  In fact, maybe command completion characters being
enabled/disabled has something to do with it.



> It works for me. I have been using this "undocumented" feature for many
> years now!

> -Ajay





> > Hi,

> > by accident I found out that, for example

> >   cd a*

> > changes to a directory that name begins with an "a" (or "A"). If there
> > are multiple matching directories, CD changes to the first match.

> Am I doing wrong?

> ====================================================
> d:\data\bat\help>ver

> Microsoft Windows 2000 [Version 5.00.2195]

> d:\data\bat\help>dir c* /ad
>  Volume in drive D is Data
>  Volume Serial Number is 549E-D90B

>  Directory of d:\data\bat\help

> 15/03/02  08:19         <DIR>          cal
> 07/03/02  14:17         <DIR>          cmdproc
> 18/05/02  12:33         <DIR>          comma
> 18/03/02  04:46         <DIR>          cx
>                0 File(s)              0 bytes
>                4 Dir(s)   5,354,176,512 bytes free

> d:\data\bat\help>cd c*
> The directory name is invalid.

> d:\data\bat\help>chdir c*
> The directory name is invalid.
> =======================================================
> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Thu, 24 Oct 2002 04:22:13


No, it's part of the CMD interpreter.  No addon software required. :-)


Quote:> You have to have the windows 2000 resource kit or support tools for this
to
> work, forgot which one.

 
 
 

Undocumted CHDIR/CD Feature

Post by Ritchi » Thu, 24 Oct 2002 06:39:22


Quote:> *does* work, as the parser can now determine you're not trying to CD to a
> filename.  Do you see what's happening?

Heeeey... its works!!!, I see what you mean. I had a quick play around
and on my system the commands:-

  'cd p*\m* o*\o*' changes to 'C:\Program Files\Microsoft Office\Office'

  'cd * *' changes to 'C:\Documents and Settings'

...More experimentation is called for I think.

I can't believe you Guys have been so selfish and kept this under wraps for
over four years ;)

Thanks, FP and Ned

--
Ritchie
Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Thu, 24 Oct 2002 11:12:07


I just *knew* you'd be a quick study :-)


Quote:> > *does* work, as the parser can now determine you're not trying to CD to
a
> > filename.  Do you see what's happening?

> Heeeey... its works!!!, I see what you mean. I had a quick play around
> and on my system the commands:-

>   'cd p*\m* o*\o*' changes to 'C:\Program Files\Microsoft Office\Office'

>   'cd * *' changes to 'C:\Documents and Settings'

> ...More experimentation is called for I think.

> I can't believe you Guys have been so selfish and kept this under wraps
for
> over four years ;)

> Thanks, FP and Ned

> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Joe Richards [MVP » Fri, 25 Oct 2002 12:37:24


This is one of those things that I just figured everyone knew... How
strange, I've been doing it for years myself though I still want an NCD
program.

--
---
Joe Richards
www.joeware.net
---

Quote:> > *does* work, as the parser can now determine you're not trying to CD to
a
> > filename.  Do you see what's happening?

> Heeeey... its works!!!, I see what you mean. I had a quick play around
> and on my system the commands:-

>   'cd p*\m* o*\o*' changes to 'C:\Program Files\Microsoft Office\Office'

>   'cd * *' changes to 'C:\Documents and Settings'

> ...More experimentation is called for I think.

> I can't believe you Guys have been so selfish and kept this under wraps
for
> over four years ;)

> Thanks, FP and Ned

> --
> Ritchie
> Undo address for mail

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Fri, 25 Oct 2002 14:02:18


Ditto on the NCD replacement - I've been hunting for an LFN-aware one (hell,
I'd be happy to find a SFN one that *worked*)  for what seems like aeons
now....hey...waitaminute...why haven't *you* written one? <g>



Quote:> This is one of those things that I just figured everyone knew... How
> strange, I've been doing it for years myself though I still want an NCD
> program.

 
 
 

Undocumted CHDIR/CD Feature

Post by Joe Richards [MVP » Mon, 28 Oct 2002 10:31:18


It is on my wish list... With about 18,000 other things. The company I do
work for has been keeping me extremely busy this last year, I'm lucky when I
don't spend 12 hours at the office anymore. The joeware tools I have worked
on lately with the exception of one have all been specifically for them.

--
Joe Richards
www.joeware.net
---


> Ditto on the NCD replacement - I've been hunting for an LFN-aware one
(hell,
> I'd be happy to find a SFN one that *worked*)  for what seems like aeons
> now....hey...waitaminute...why haven't *you* written one? <g>



> > This is one of those things that I just figured everyone knew... How
> > strange, I've been doing it for years myself though I still want an NCD
> > program.

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Mon, 28 Oct 2002 16:18:12


:-(

Well, I'll wait for a lull in your schedule then...  ;-)



> It is on my wish list... With about 18,000 other things. The company I do
> work for has been keeping me extremely busy this last year, I'm lucky when
I
> don't spend 12 hours at the office anymore. The joeware tools I have
worked
> on lately with the exception of one have all been specifically for them.

> --
> Joe Richards
> www.joeware.net
> ---



> > Ditto on the NCD replacement - I've been hunting for an LFN-aware one
> (hell,
> > I'd be happy to find a SFN one that *worked*)  for what seems like aeons
> > now....hey...waitaminute...why haven't *you* written one? <g>

 
 
 

Undocumted CHDIR/CD Feature

Post by Joe Richards [MVP » Tue, 29 Oct 2002 00:29:32


Maybe we can talk Marty into * something up depending on his schedule
too....

--
Joe Richards
www.joeware.net
---


> :-(

> Well, I'll wait for a lull in your schedule then...  ;-)



> > It is on my wish list... With about 18,000 other things. The company I
do
> > work for has been keeping me extremely busy this last year, I'm lucky
when
> I
> > don't spend 12 hours at the office anymore. The joeware tools I have
> worked
> > on lately with the exception of one have all been specifically for them.

> > --
> > Joe Richards
> > www.joeware.net
> > ---



> > > Ditto on the NCD replacement - I've been hunting for an LFN-aware one
> > (hell,
> > > I'd be happy to find a SFN one that *worked*)  for what seems like
aeons
> > > now....hey...waitaminute...why haven't *you* written one? <g>

 
 
 

Undocumted CHDIR/CD Feature

Post by Ned Flander » Wed, 30 Oct 2002 01:09:10


This looks pretty dang close.  Other than the batch approach I *really* like
it.  The batch is a nit really, I just have to remember to CALL it if I'm
using this in another batch routine.  Maybe I'll mess around and see if I
can wrap this in VBS or something to make it more "exe-like" so I don't have
to worry about breaking CMD/BAT file execution as much.

Summary:  I *love* it.  You are the wind beneath my wings..... ;-)


> Hmmm, sounds interesting.  I haven't used ncd in years, I've forgotten
most
> of it's functionality.  I remember being able to use the arrow keys for
> command completion, and I seem to remember those annoying NCDTREE folders
in
> the root.

> I have a similar program in my toolbox (that I never remember to use)
called
> wcd (Wherever Change Directory).  How close does this come to ncd?
> http://www.veryComputer.com/~waterlan/



> > Maybe we can talk Marty into * something up depending on his
> schedule
> > too....

> > --
> > Joe Richards
> > www.joeware.net
> > ---



> > > :-(

> > > Well, I'll wait for a lull in your schedule then...  ;-)



> > > > It is on my wish list... With about 18,000 other things. The company
I
> > do
> > > > work for has been keeping me extremely busy this last year, I'm
lucky
> > when
> > > I
> > > > don't spend 12 hours at the office anymore. The joeware tools I have
> > > worked
> > > > on lately with the exception of one have all been specifically for
> them.

> > > > --
> > > > Joe Richards
> > > > www.joeware.net
> > > > ---



> > > > > Ditto on the NCD replacement - I've been hunting for an LFN-aware
> one
> > > > (hell,
> > > > > I'd be happy to find a SFN one that *worked*)  for what seems like
> > aeons
> > > > > now....hey...waitaminute...why haven't *you* written one? <g>

 
 
 

Undocumted CHDIR/CD Feature

Post by Marty Lis » Wed, 30 Oct 2002 00:49:04


Hmmm, sounds interesting.  I haven't used ncd in years, I've forgotten most
of it's functionality.  I remember being able to use the arrow keys for
command completion, and I seem to remember those annoying NCDTREE folders in
the root.

I have a similar program in my toolbox (that I never remember to use) called
wcd (Wherever Change Directory).  How close does this come to ncd?
http://www.veryComputer.com/~waterlan/



> Maybe we can talk Marty into * something up depending on his
schedule
> too....

> --
> Joe Richards
> www.joeware.net
> ---



> > :-(

> > Well, I'll wait for a lull in your schedule then...  ;-)



> > > It is on my wish list... With about 18,000 other things. The company I
> do
> > > work for has been keeping me extremely busy this last year, I'm lucky
> when
> > I
> > > don't spend 12 hours at the office anymore. The joeware tools I have
> > worked
> > > on lately with the exception of one have all been specifically for
them.

> > > --
> > > Joe Richards
> > > www.joeware.net
> > > ---



> > > > Ditto on the NCD replacement - I've been hunting for an LFN-aware
one
> > > (hell,
> > > > I'd be happy to find a SFN one that *worked*)  for what seems like
> aeons
> > > > now....hey...waitaminute...why haven't *you* written one? <g>

 
 
 

1. chdir / cd

The actions and results you listed do not correlate with the responses I
receive from my command shell. Are you running CMD.EXE or COMMAND.COM.
It is feasible these changes may also relate to the use of Command
Extensions.

cd /? <paste>

If Command Extensions are enabled CHDIR changes as follows:

The current directory string is converted to use the same case as
the on disk names.  So CD C:\TEMP would actually set the current
directory to C:\Temp if that is the case on disk.

CHDIR command does not treat spaces as delimiters, so it is possible to
CD into a subdirectory name that contains a space without surrounding
the name with quotes.  For example:

    cd \winnt\profiles\username\programs\start menu

is the same as:

    cd "\winnt\profiles\username\programs\start menu"

which is what you would have to type if extensions were disabled.

Command extension are enabled by default but can be controlled. Type CMD
/? for further information.

HTH

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology

[[ Please respond to the Newsgroup only ]]


2. she can improve undoubtably if Ramez's film isn't cheap

3. CD or CHDIR commands does not well work

4. Scheduling tasks

5. chdir or cd doesn't work...

6. Epson Color Stylus Drivers

7. chdir / cd

8. 2 SmartSuite Questions

9. Most popular features - New features

10. cd auto play feature

11. Cool new feature for CD drives in W2K

12. Need help turning on the CD ROM's autorun feature

13. Feature you are trying to use is not avalible - Please insert Cd