Announcement

Collapse
No announcement yet.

.bat file to count files and delete them

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • .bat file to count files and delete them

    Hi,

    i try to insert a command in a script to count if there are 31 files in a folder then delete all the files...
    I can count succesfully the number of files in afolder witht the following command:

    dir "C:\Scripts" /b/s |find /v /c "::"

    Now i am trying to make an IF statement but i cant find the right format:

    IF dir "C:\Scripts" /b/s |find /v /c "::" == 31
    del ARCHIVE_FOLDER\* /Q

    doesnt work...Any help?
Working...
X