|Ok I get the directory counts using this:|
dir "c:\mydir1" /ad /o-d /b | find /c /v "::"
I send out alerts via email using bmail:
c:\bmail.exe -s servername -t emailstosendto (some other switches)
To clarify here is what I need it to do:
1. Count the number of directories
2. If less then specified amount (N) goto :less
3. If more then N goto :delete
: delete will delete N+1 directories (oldest first) so if N is 5 and there are 15 dirs it would delete the oldest 10 and leave the newest 5
:less I can handle from here.