vrijdag 12 december 2008

Dos batch command for

Very handy! You can specify a 'normal' dir & filter (find) in the dos for command to filter files/directories.


 

FOR /F %%k in ('DIR /A:D /B *.DB ^| FIND /V "Autor"') do FOR /F %%j in ('DIR /B "%%k\stored procedures\*.sql" ^| FIND /V "Gebruiker"') do copy %sql% /b + "%%k\stored procedures\%%j" /b


 

from http://www.robvanderwoude.com/bht.html


 

Or use FOR /F in NT 4+:

FOR /F "tokens=1 delims= " %%A IN ('DIR *.DOC ^| FIND "File(s)"') DO SET NumDocs=%%A

ECHO %NumDocs% MS-Word documents found

Geen opmerkingen: