Try this (presuming WinNT/2K/2003/XP[Vista?]), but beware it could
take quite a while to scan a whole drive ...
(@for /r "C:\" %a in (*.*) do if %~za==0 echo %~fa) > out.txt
If you put it in a batch file, double up the percent signs.
Didn't work properly for me under XP - reported each FOR iteration into the
file. ~z modifier is not available under NT, not sure about 2K.
From the prompt,
@echo off&(@for /r "C:\" %a in (*.*) do if %~za==0 >>out.txt echo %a&echo on
Seemed to work fine though - but you'd have to delete out.txt first as the
output is APPENDED to the file
This solution developed using XP
----- batch begins -------
[1]@echo off
[2]del out.txt 2>nul
[3]for /r "C:\106x" %%a in (*.*) do if %%~za==0 >>out.txt echo %%a
------ batch ends --------
Lines start [number] - any lines not starting [number] have been wrapped and
should be rejoined. The [number] that starts the line should be removed
C:\106x... is my test directory - simply replace with YOUR start-directory's
name.