Win 7 DIR /S command and junctions and links

Microsoft Windows 7 ultimate 32-bit
January 27, 2010 at 02:44:35
Specs: Windows Vista Ultimate SP2, 3GB
Hi, my turn to ask a question ;->

Is there a way to tell the DIR /S command (in cmd.exe) not to follow NTFS junctions and directory symbolic links?

It's just that in my C:\inetpub\ftproot folder, there is a junction to C:\ and so when I do a DIR /S C:\ it gets into an infinite loop. I just wanted it to report the junction as a junction and leave it at that.

If it's not possible in CMD.EXE, can it be done in PowerShell or VBScript?

See More: Win 7 DIR /S command and junctions and links

Report •

January 27, 2010 at 08:16:56
when I do a DIR /S C:\

Shouldn't the drive-letter come before the switch?

DIR C:\ /S

Report •

January 27, 2010 at 08:44:26
It works with the switch either before or after, it doesn't seem to matter.

Report •

January 27, 2010 at 12:23:15
Not according to what I read on Microsoft's own help page.
The correct syntax is quite clear to see and it says nothing about changing the order of the syntax string:

Report •

Related Solutions

January 27, 2010 at 15:58:20
Yes ok, so it's documented that way around. In that case,
may I rephrase my question and substitute

DIR C:\ /S


DIR /S C:\

in my original question. Everything else stays the same.
Same problem.

-- klint

Report •

Ask Question