We open the 'Task Scheduler' console by pressing the "Windows + R" keys and typing "taskschd.msc" in the window that opens. We click on "Create Task" and enter a name and description for the new task. We check the box "Run whether user is logged on or not" to run the program with administrator privileges.
Navigate to the "Actions" Tab "New" Action
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
Get-ChildItem -Path C:test -Include *.* -Recurse | foreach { $_. Delete()}
Wear and save your commands in the corresponding field.
Configure the above command according to the directory you will delete according to yourself