TCC dir /s command not showing all folders

Aug 19, 2009
16
2
TCC and TCC/LE version 11.0.x and the new version 12.0.32 seems to have a general problem when using dir /s to search for a specific folder name.

If I search for a specific folder without using wildcards like 'dir /s foldername' and an empty folder with that specific name exists, the folder is not listed. The reason for this, I believe, is that TCC and TCC/LE thinks that I want the contents of this specific folder to be listed and not the folder itself. This is even if I specify the /a:d switch. CMD.exe seems to do this right (IMO ;)).

To illustrate the problem, I've created a script that creates a couple of directories and then executes dir commands with different switches and search patterns. The script is attached together with the result from TCC 11.00.52 and TCC 12.00.32. If you run the script, you'll see that the folder named 'folder2' is never listed unless wildcards are used in the search pattern.

Best regards
Ernst Mikkelsen
EM-Soft
 

Attachments

  • JPtest.btm
    447 bytes · Views: 103
  • JPtest-11.jpg
    JPtest-11.jpg
    14.6 KB · Views: 119
  • JPtest-12.jpg
    JPtest-12.jpg
    14.4 KB · Views: 116

rconn

Administrator
Staff member
May 14, 2008
12,406
152
TCC and TCC/LE version 11.0.x and the new version 12.0.32 seems to have a general problem when using dir /s to search for a specific folder name.

If I search for a specific folder without using wildcards like 'dir /s foldername' and an empty folder with that specific name exists, the folder is not listed. The reason for this, I believe, is that TCC and TCC/LE thinks that I want the contents of this specific folder to be listed and not the folder itself. This is even if I specify the /a:d switch. CMD.exe seems to do this right (IMO ;)).

WAD. TCC (and 4NT and 4DOS all the way back to the beginning) have always behaved this way. The reasoning is that expanding the argument name first (to resolve things like "....\foo", extended wildcards, directory wildcards, URLs, etc.) was more important than having DIR behave differently depending on whether the specified directory was in the current directory or a subdirectory. (A rather dubious CMD behavior, and one I've never actually seen documented.)
 
Aug 19, 2009
16
2
WAD. TCC (and 4NT and 4DOS all the way back to the beginning) have always behaved this way. The reasoning is that expanding the argument name first (to resolve things like "....\foo", extended wildcards, directory wildcards, URLs, etc.) was more important than having DIR behave differently depending on whether the specified directory was in the current directory or a subdirectory. (A rather dubious CMD behavior, and one I've never actually seen documented.)

Okay, so doing a "dir /bsa:d C:\Desktop" giving an empty result is not considered an error in your opinion?

Example:
dir /bsa:d C:\Users\Desktop
<empty result="">[Empty List]

dir /bsa:d C:\Users\Deskto?
C:\Users\All Users\Desktop
C:\Users\Default\Desktop
C:\Users\EPM\Desktop
C:\Users\Public\Desktop

I will try to twist my mind, and try remembering to always replace the last character with a question mark when searching for a specific directory.;)

Best regards
Ernst Mikkelsen
EM-Soft</empty>
 
May 30, 2008
235
2
Pretty interesting! I never considered that this is how DIR /S works in TCC.

Okay, so doing a "dir /bsa:d C:\Desktop" giving an empty result is not considered an error in your opinion?

Example:
dir /bsa:d C:\Users\Desktop
<empty result="">[Empty List]
</empty>

Well, it will show the sub-directories of desktop if there are any. ;) I had quite a few.

But the "replace last char with ?" trick works quite well. Thanks for that tip! Might come in handy some time.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
Okay, so doing a "dir /bsa:d C:\Desktop" giving an empty result is not considered an error in your opinion?

No, it's not. Certainly not enough to remove a half-dozen more important features in order to support this. (Apparently it's also not that important to anybody else, as this is the first time this issue has come up in 20 years!)

CMD behaving differently depending on whether the target is in the current directory or a subdirectory isn't considered an error in your opinion?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,497
91
Albuquerque, NM
prospero.unm.edu
<empty result="">
I will try to twist my mind, and try remembering to always replace the last character with a question mark when searching for a specific directory.;)
</empty>

If you only want to find subdirectories named "Desktop" and not "DeskTo1", "DesktoA", "Deskto_" and so on, add a pair of brackets instead:

Code:
dir /b /s /a:d c:\users\desktop[]

That's a wildcard too, just a more restrictive one.
 
May 20, 2008
603
0
Sammamish, WA
For what it's worth, my timedir has a switch that will enable the behavior
you want. By default I behave the same way as TCC does.

D:\JPtest>timedir /b /s folder2

D:\JPtest>timedir /b /s folder2 /\
D:\JPtest\JPsoft\folder2

You can find my timedir at jcook.net/timedir in case it proves useful to
you.

On Thu, Oct 28, 2010 at 11:42, erpomik <> wrote:


> TCC and TCC/LE version 11.0.x and the new version 12.0.32 seems to have a
> general problem when using dir /s to search for a specific folder name.
>
> If I search for a specific folder without using wildcards like 'dir /s
> foldername' and an empty folder with that specific name exists, the folder
> is not listed. The reason for this, I believe, is that TCC and TCC/LE thinks
> that I want the contents of this specific folder to be listed and not the
> folder itself. This is even if I specify the /a:d switch. CMD.exe seems to
> do this right (IMO ;)).
>
> To illustrate the problem, I've created a script that creates a couple of
> directories and then executes dir commands with different switches and
> search patterns. The script is attached together with the result from TCC
> 11.00.52 and TCC 12.00.32. If you run the script, you'll see that the folder
> named 'folder2' is never listed unless wildcards are used in the search
> pattern.
>
> Best regards
> Ernst Mikkelsen
> EM-Soft
>
> Attached to this message is JPtest.btm (
> http://jpsoft.com/forums/attachment.php?attachmentid=150&d=1288291087)<br>Attached
> to this message is JPtest-11.jpg (
> http://jpsoft.com/forums/attachment.php?attachmentid=151&d=1288291134)<br>Attached
> to this message is JPtest-12.jpg (
> http://jpsoft.com/forums/attachment.php?attachmentid=152&d=1288291157)<br>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
Similar threads
Thread starter Title Forum Replies Date
M TCC incorrect dir output since Windows 1803 Support 6
dcantor WAD dir "ftp:// ..." fails in TCC 15 Support 7
A WAD Dir daterange + multiple path wildcards crashes tcc Support 2
B TCC 11 - Dir /2? Support 5
A Can you set an image file 'tag' with TCC/4NT? Support 2
P PSHELL not working in TCC 26 Support 9
vefatica SCRIPT makes TCC disappear. Support 16
MickeyF TCC suddenly crashing (not TCC's fault) Support 2
Z CMDDebug - TCC unknown command Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 28.02.17 Support 0
vefatica TCC startup: /IP not honored after /K Support 1
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
C COMSPEC constantly reset to TCC.EXE Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Jay Sage Extra TCC Tasks Support 6
vefatica Can I turn off the minimize to tray mechanism in TCC? Support 5
N Command execution slows down in TCC Prompt after a while Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
samintz How to? Is this doable in TCC? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
D TCC tab detaching & restarting Support 3
Ó Recent git output not shown on TCC Support 1
P Kill all other instances of tcc from a btm batch file Support 2
L Using TCC.exe through an SSH connection Support 3
M TCC color issue in ConEmu Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
Alpengreis Python support for 3.8.3 in TCC v26.x? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.01.40 uploaded Support 0

Similar threads