pdir /s

Nov 13, 2008
255
3
www.thedave.me
I'm seeing a change in behaviour of pdir from v16 to v23: It seems that "pdir /s w:\directory" no longer returns any content from subdirectories, whereas if I omit w:\directory and let it act on the current directory then it does return content from subdirectories.

TCC 16.03.55 x64 Windows Server 2012R2 [Version 6.3.9600]
Code:
[W:\Software]pdir /s W:\Software | find ":" /c
10766
TCC 23.00.24 x64 Windows Server 2012R2 [Version 6.3.9600]
Code:
[W:\Software]pdir /s W:\Software | find ":" /c
103
[W:\Software]pdir /s | find ":" /c
10766
Is this an intentional change or a bug?
 
May 20, 2008
10,498
77
Syracuse, NY, USA
apparently, with v23, you need a trailing '\' when specifying a directory name. Here's v16.
Code:
c:\users> pdir /s | find ":" /c
16850

c:\users> pdir /s c:\users | find ":" /c
16850

c:\users> pdir /s c:\users\ | find ":" /c
16850
And here's v23.
Code:
c:\users> pdir /s | find ":" /c
16850

c:\users> pdir /s c:\users | find ":" /c
4

c:\users> pdir /s c:\users\ | find ":" /c
16850
 

rconn

Administrator
Staff member
May 14, 2008
11,894
133
I made a change for this in v21, but I can't remember *why* I changed it. My best guess at the moment is I needed to change DIR (which shares some code with PDIR), but I didn't make the corresponding change in PDIR. For some reason -- which could be because I forgot, or I had a real reason.

I'm going to have to ponder this for a day and look over my old notes to jog my memory.