charles gentry :
I'm looking for a dir command that displays each file with complete path, with file sizes. "dir /s /b" doesn't show sizes.
@REM =======================
@REM newdir.cmd
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /R . %F in (*) DO (
set y=0000000000%%~zF
echo %%~tF !y:~-10! %%~fF )
@echo on
@REM =======================
run command: newdir
or to sort by size
run command: newdir | sort /+21
obviously can add arguments to make it better
set arg1=%1 @rem expecting . or directory eg c:\tmp\
set arg2=%2 @rem expecting wildcard * or *.tmp or *.bak
FOR /R %arg1% %%F in (%arg2%) DO ( ....
~?F e.g. ~zF values examples are:
~a attributes,
~d drive ,
~f full filename,
~n name of file without ext,
~p = folder(s),
~s= short filename,
~t = datetime stamp,
~x=ext,
~z = size in bytes
Cheers
LAMS