If you want to delete files manually, you can use the Windows Delete command. This command is located in the Start menu and it’s usually just a right-click on the file you want to delete and then select Delete.
The easiest way to delete files is to use a batch file. You can create the batch file without any third-party software, and then schedule it to run on a regular basis. In this article, I’ll show you how to create the batch file and use Task Scheduler to have it run automatically. ..
Step 1 – Create Batch File
Notepad -e “C:\Windows\SysWOW64\cmd.exe” Now open Notepad and paste the following line of text: Notepad -e “C:\Windows\SysWOW64\cmd.exe” -v Now open Notepad and change the value of the -v flag to 1.
Notepad: #! /usr/bin/notepad -n -f “C:\Test\file.txt” -d “5 days” The above will create a Notepad file that deletes all files in the C:\Test folder and sub-folders that are older than 5 days.
To test the batch file, open it in a text editor like Notepad and change the value of C to D: D:\Test\test.bat ..
Did anything get deleted? Probably not! ..
The command to delete files is /D -5. This means that if a file is 5 days or older, it will be deleted. To delete any file regardless of when it was created, you can either change the -5 to -0 or you can remove the /D -5 part altogether.
To customize the command, the first thing you can do is change the directory to something other than C:\Test. That’s as simple as copying the path from Windows Explorer for the directory you want and pasting it into the command in Notepad.
Next, you need to specify the directory path where you want the command to look for files. The -s parameter tells the command to search all sub-folders as well. If you don’t want to delete files from sub-folders, use the -s parameter.
Next is the -m command followed by the file type you want to delete. For example, if you want to delete all PDF files in a folder, use -m pdf.
The /D -X command allows you to specify a deletion age for files. Files that are older than the specified age will be deleted. ..
To delete files and folders, use the following command: C:\Windows\system32\delta.exe /delete
To delete all files older than 180 days, type: del *.pdf *.docx ..
Step 2 – Schedule Batch File
To open Task Scheduler, open the Start screen and type task scheduler. Then hit enter. Task Scheduler will open and you will see a list of all the tasks that have been scheduled for execution on your computer. You can right-click on any of these tasks and select “Schedule This Task For” to have it run at a specific time or date.
If you’re like most people, your PC startup routine is a bit of a mystery. You know it’s time to turn on your computer when the screen goes blank, but you don’t know what to do with the rest of your day. That’s where a batch file can come in handy. A batch file is a collection of instructions that are run one at a time, and it can help you get things done more efficiently. To create a batch file, you first need to create an empty directory on your PC. Then, you’ll need to find the files that pertain to your startup routine. Here are some examples: C:\Windows\system32\cmd.exe -executionpolicy unrestricted -c “netstat -an” This will show you all active network connections and their status. You can then use this information to schedule tasks or start programs using this information as the basis for your batch file. For example, if you want to start Windows Update every morning at 7am, you could use this code: C:\Windows\system32\cmd.exe -executionpolicy unrestricted -c “netstat -an” | netsetup
The only thing you need to change is the Trigger. You can choose from Daily, Weekly, Monthly, When the computer starts, When I log on or When a specific event is logged.
When you create a new Weekly or Monthly script, you can choose the exact day and time range for it to run. ..
This is a solution for people who need to delete files on their PCs. If you have any questions, feel free to post a comment. Enjoy!