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

SignUp Now!

dir /s dies on my C: drive

Note: This problem is solved, as far as I'm concerned. I just thought I'd report the symptoms and my workaround.

TCMD v11.00.52
TCMD v14.03.59 x64

I did a dir /s "*something*" on D:\; it worked fine. I did the same on C:\; TCC died. With v11, Windows gave me the "TCC has stopped working" dialog boxes. With v14, the TCC window just vanished with no warning.

This behavior was apparently caused by some circular directory pointers. (Darn Windows and its hidden virtual directories!) I had built a new PC, and had to install Windows a couple of times. The second time, I renamed C:\Windows to C:\windows.old, then did the install. When the dir command processed the C:\windows.old directory, I think it went into a loop on these virtual dir pointers.

I did a "move /s/a: c:\windows.old d:\windows-old-from-c\", but it also went into a loop (obvious, from the path names it was displaying), and eventually died. A Windows Explorer cut-and-paste of the directory worked fine. After that, I was able to do successful "dir /s" commands on both C:\ and D:\.

Comments/criticisms (even of the "you're an idiot" type) are welcomed.
The /nj (no junctions) option should stop the circulus vitiosus, since only the use of junctions can create an infinite loop. It is part of my alias DIRS I use for displaying a directory tree. It still displays the directory which is a junction, and its target, but it does not display the contents of the junction and thus avoids the infinite loop.

Another method is to use the /Sn syntax to limit the depth to which it traverses the directory tree; it will display the chain of hidden links, but stops after displaying n levels of the hierarchy.

The same options are available for most commands that can handle directory trees, e.g., COPY, MOVE, TREE, and have been available in TCMD 11 already.
HTH, Steve
[FOX] Ultimate Translator