Dir

examples

 * dir d:\tech /n /s | find "03/28/2018"


 * clearlyandsimply.com

"dir /b /a-d /s"

SQL Server

 * master..xp_cmdshell 'dir d:\*.bak /s'

-- using powershell on the d:\backup\ folder
 * master..xp_cmdshell 'powershell -noprofile -command "ls d:\backup\ -r|measure -s Length"'
 * source: http://stackoverflow.com/questions/12813826/get-folder-size-from-windows-command-line