Search this site
Embedded Files
Shadow Techs
  • Home
  • Expertise
    • Business Phone Systems
    • Remote access and security
  • Best Practices
  • Tech Resources
    • Info
      • FreePBX Info
      • Adobe Acrobat Info
      • Windows Info
    • Utilities
      • GCPW
    • Fixes
    • How to
    • Links
  • Contact
Shadow Techs
  • Home
  • Expertise
    • Business Phone Systems
    • Remote access and security
  • Best Practices
  • Tech Resources
    • Info
      • FreePBX Info
      • Adobe Acrobat Info
      • Windows Info
    • Utilities
      • GCPW
    • Fixes
    • How to
    • Links
  • Contact
  • More
    • Home
    • Expertise
      • Business Phone Systems
      • Remote access and security
    • Best Practices
    • Tech Resources
      • Info
        • FreePBX Info
        • Adobe Acrobat Info
        • Windows Info
      • Utilities
        • GCPW
      • Fixes
      • How to
      • Links
    • Contact
  1. Open Notepad or any text editor on your Windows computer.

  2. Type the following command in the text editor:

forfiles /p "C:\path\to\folder" /s /m *.* /d -7 /c "cmd /c del @path"

  1. Replace "C:\path\to\folder" with the actual path to the folder that contains the files you want to delete.

  2. Replace "-7" with the number of days you want to use as the cutoff age for deleting files. In this example, "-7" means that any file older than 7 days will be deleted.

  3. Save the file with a .bat extension, such as "delete_old_files.bat".

  4. Double-click the .bat file to run the script. It will automatically delete any files in the specified folder that are older than the number of days you specified.

Report abuse
Report abuse