Automating Windows Storage Is a Must! (and How to Do It)

by -
Photo: Bloomicon (Shutterstock)

techno.rentetan.com – You need to automate one of the most tedious operations on your computer. Take a few simple actions to solve your issue if you are running out of storage space on your computer. If you’re like most of us, you’ve amassed a mountain of useless data on your computer. Instead of spending money to upgrade your storage, try teaching your computer how to do it for you.

The built-in Windows capability may be used to remove unnecessary files

Screenshot: Pranay Parab

Storage Sense, a built-in Windows tool, may help you get rid of unnecessary files. On the other hand, if your computer is running low on storage space, it may run itself automatically. It will automatically erase outdated files from the Recycle Bin, remove temporary files, and help you understand which sorts of files are taking up the most space on each of your hard drives. Go to Settings > System > Storage on your Windows PC to configure it. The right pane of the window displays additional information about huge files and directories.

In Windows, how do you set up Storage Sense?

Click the option labeled Setup Storage Sense or run it immediately to configure Storage Sense. To activate Storage Sense, click the “Off” button underneath it (which turns to “On” while active). When you want your computer to automatically clean up, choose Run Storage Sense from the Run menu. Storage Sense may also be triggered when your machine is running short on storage space.

Delete temporary files that my programs aren’t utilizing is one of the other useful choices on this page. In addition, if you haven’t used them in over a week, you can select Delete files from my recycle bin from the drop-down list. Recycle bins may be cleared every one to 60 days, depending on the option you choose.

Delete files in my Downloads folder if they haven’t been accessed for more than is another handy option. A time range of one to 60 days may be selected for this feature, which allows you to automatically remove unneeded files from your downloads folder.

How to set up an automated disk cleaning

Screenshot: Pranay Parab

Windows’ Disk Cleanup software may also be used to automatically clear up storage space. The only difference between this approach and the previous one is that it needs you to write a single line of code into the Command Prompt. You’ll just need to have administrator access to your account to use it.

Select Windows Powershell (Admin) from the menu by pressing the Windows Key + X. Cleanmgr/sageset:9000 can be typed into the command line by pressing the Enter key. If you like, you may substitute a different integer value between 0 and 9999 for the default.

You’ll be presented with a window where you may pick and choose whatever files you want to have automatically deleted. Click OK to exit the Powershell window once you’ve picked the files you need. Use the Windows search box to launch Task Scheduler and choose Action > Create Basic Task from the drop-down menu. Schedule this task by providing it with a name and description using the on-screen prompts (daily, weekly, monthly, when the computer starts, etc.).

At this point, you’ll see the Actions tab. Start a program, enter C:Windowssystem32, click Next, and confirm whether the schedule is correct before clicking Finish. Disk Cleanup will now delete the chosen files on a predetermined period.

The best way to delete files from particular locations in Windows

Screenshot: Pranay Parab

It is possible to utilize an alternate way to get rid of folders that are taking up a lot of storage space on your computer. Copy the following command and paste it into a new note in Notepad on your PC: files -p “C:UsersYOURUSERNAME/Downloads” for files Deleting the @path: cmd /c Del @path 60.

All files older than 60 days will be deleted from your computer’s Downloads folder. The username of your account may be substituted for YOURUSERNAME.

Learn how to make changes to the command prompt on your computer

You may adjust the path to change which folder is automatically cleaned up. C:UsersYOURUSERNAMEDownloads is the portion that reads C:Users. In Windows Explorer, you may copy the path of any folder by opening it and clicking the address bar. When removing files from the Downloads folder, the -s option instructs your automation to take into account any subfolders inside that folder. If you don’t want to delete anything in the sub-folders, you may uncheck this box.

The -m . argument, which allows you to choose certain file types from the folder, is the most intriguing element. If you wish to exclusively destroy JPG files, you may alter this to -m .jpg or any other file type you want to target. Using the command ‘.‘ instead of ‘.‘ instructs the program to delete all files in the folder.

It’s also possible to set a time limit for a file to be considered for deletion using the /D option. /D -30 deletes files older than 30 days; the value you provide here may be whatever number you choose.

To save the command as DeleteAutomatically.bat, go to File > Save As and choose DeleteAutomatically.bat from the drop-down menu. The filename isn’t important, but the.bat extension is, so don’t save this as a txt file.

Once again, Task Scheduler may be used to execute a program at a predetermined time period, as discussed in the previous section. Use the Browse option to find the file called DeleteAutomatically.bat or whatever you named it while choosing the program.