Whether you share your computer with other people or you use it for a lot of downloads, it is nice to be able to clear out the download folder without having to manually take care of it each week or month, which is when an automated deletion comes in handy.
You can automate the cleanup of your download folder using a batch file that will delete files older than a certain amount of days. You can run this whenever you feel that you need to clean up your download folder or you can use the Task Scheduler to run it daily, weekly, monthly, etc.
Create Your Batch File:
The following script to automatically delete files that are older than 30 days from the downloads folder:
First open notepad then paste this script into the screen.
REM Remove files older than 30 days
forfiles /p "C:\Users\YOURUSERNAME\Downloads" /s /m *.* /c "cmd /c Del @path" /d -30
Replace YOURUSERNAME with the username listed in the path on your computer.
Remember to change the directory to match your computer. You can also choose any directory that is on your computer for the target. Once you have entered the script, Hit Ctrl+S to save the file, and save it as .bat in a safe location.
Simply run the file to make sure it works and you will see that any files in your download folder are automatically sent to your Recycle Bin if they are older than 30 days.
Create a Scheduled Task:
We will schedule the automatic file deletion on every seven days, Begin by opening the Start menu and typing in “Task Scheduler” then running the application.
Alternatively, you can open your “Control Panel”. Under the “System and Security” section select the “Administrative Tools” option and then run the “Task Scheduler”.
From the menu, navigate to Action --> “Create Basic Task”.
Give the task a name and description in the window that appears. For this example, we will call it “Weekly Download Cleanup” and leave the description empty since the title is self-explanatory; then click “Next”.
On the next step,"Trigger" will be highlighted in the left menu. Select whether you want the task to initiate daily, weekly, monthly, and so on., then click “Next”.
Now you will need to select a time and day. Remember to choose a time and day that your computer is powered on. For this example, we will just choose midnight on Friday then click Next.
Now you will see the “Action” screen. We will leave this as is, since we want to run a specific program every Friday; so you can just click “Next”.
Click the browse button, and navigate to the batch file you created before and select it. As you can see, our batch file was saved on the desktop and is called “DownloadCleanup.bat”. Once you have done that, just click “Next”.
On the last screen, you'll see an overview of what you've just created. Once you verify that everything is right, just click “Finish” to complete the task creation and it will run automatically according to your specifications.
Now the batch file will launch according to the preferences you selected in "Task Scheduler", sending your old files in your Downloads folder to your Recycle Bin.
Recommended article: Chomsky: We Are All – Fill in the Blank.
This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
No comments:
Post a Comment