Windows 10: Batch File to delete folders and its files later than 10 days

Discus and support Batch File to delete folders and its files later than 10 days in Windows 10 Network and Sharing to solve the problem; Hello, I have folders and thier files that get backed up every so often and get put into a folder named bk_Operator Rate Program. In the bk_Operator... Discussion in 'Windows 10 Network and Sharing' started by SoggyCashew, Feb 19, 2019.

  1. Batch File to delete folders and its files later than 10 days


    Hello, I have folders and thier files that get backed up every so often and get put into a folder named bk_Operator Rate Program. In the bk_Operator Rate Program folder there are folders with thier files within this main folder and they are named by the date they were backed up. Example: bk_ORP_ 02-19-2019. I try to run the bat file below but I get an error.


    ERROR: Invalid argument/optin - '@isdir'.

    Type "FORFILES /?" for usage.


    Here is my .bat file


    @echo off


    FORFILES -P "H:\BACKUPS\bk_Operator Rate Program\" -d -10 -c "cmd /c IF @isdir == TRUE rd /S /Q @path"


    pause >nul

    :)
     
    SoggyCashew, Feb 19, 2019
    #1
  2. oily_17 Win User

    Batch Files Knowledge Base

    Don't use batch files very much but one I find useful is for creating a list of files in a directory.
    Just copy the text below into Notepad and save as Filelist.bat

    dir /a /-p /o:gen >filelist.txt

    When you run it from a folder it will create a Filelist.txt file,in the same folder, that lists all the files in that folder.Useful when you are too lazy to type all the files out yourself.
     
    oily_17, Feb 19, 2019
    #2
  3. Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Feb 19, 2019
    #3
  4. Batch File to delete folders and its files later than 10 days

    Batch file

    in fact when i reset a user password it is supposed to print the generated password to a printer but i don't want to print it. i want the batch file to open the .spl file generated in notepad, i note the password then on closing the notepad, the files .shd and .spl are deleted permanently from the folder
     
    Sandeep Bhugoo, Feb 19, 2019
    #4
Thema:

Batch File to delete folders and its files later than 10 days

Loading...
  1. Batch File to delete folders and its files later than 10 days - Similar Threads - Batch File delete

  2. Batch File

    in Windows 10 Software and Apps
    Batch File: Hi, I am trying to create a batch file to determine whether a user account is signed on.I don't have enough experience to get it to @Echo it worked. Any advice please.Batch file:REM Query whether user SBackup is active@echo onsetlocal enabledelayedexpansionset...
  3. Batch Files

    in Windows 10 Gaming
    Batch Files: How do i make it that my batch file puts itself in to startup https://answers.microsoft.com/en-us/windows/forum/all/batch-files/6156404d-20d4-4f58-bee5-14629dbf7b10
  4. Batch Files

    in Windows 10 Software and Apps
    Batch Files: How do i make it that my batch file puts itself in to startup https://answers.microsoft.com/en-us/windows/forum/all/batch-files/6156404d-20d4-4f58-bee5-14629dbf7b10
  5. Delete similar files by batch file?

    in Windows 10 Graphic Cards
    Delete similar files by batch file?: Hello everybody! I'm writing a batch file that I want to use to delete different folders, whose folder name starts with the same name (e.g. Test) but ends differently (i.e. test number, test digit, etc.). Is there any solution for this? Or do I have to list every single...
  6. Taking more than a day to delete thousands of small files?

    in Windows 10 Ask Insider
    Taking more than a day to delete thousands of small files?: I have a 1TB SSD that has a folder named temp with 65,000+ png files in it. I'm trying to delete that folder and it takes forever, either from Explorer or from the command line. I have tried del /s/f/q E:\temp > nul rd /s/f/q E:\temp and it has been running for over a day...
  7. Batch File

    in Windows 10 Support
    Batch File: I need a batch file to create a folder with sub folders. The sub folders will be named the current date, they will go in a folder on c drive. For example we can call the folder test and it would be in documents on c drive. Every time we run the batch file it would create a...
  8. How to use batch file to delete specific sub-folders in a folder?

    in Windows 10 Ask Insider
    How to use batch file to delete specific sub-folders in a folder?: TL;DR I have a folder, and in it, a new sub-folder is added every day. What commands can I add to a batch file that will keep only the three most recently added sub-folders in this folder? Hi all. On my computer I have a folder named folder-data with several files and...
  9. Batch Folder and Batch File/Move Software

    in Windows 10 Software and Apps
    Batch Folder and Batch File/Move Software: Looking for recommendations for software that handles automatic batch folder creation according to defined rules. Also looking for software that handles automatic file and folder moving into more than one directory according to selection criteria (size, date, extension,...
  10. Batch Rename Deletes Files

    in Windows 10 Performance & Maintenance
    Batch Rename Deletes Files: Hey all, I just upgraded to Windows 10 last night, and I've been playing around with the new File Explorer. One thing I tried was the batch rename function (by which I mean just selecting multiple files and clicking "rename"). I quickly realized that it behaves differently...

Users found this page by searching for:

  1. windows batch file to delete folders