Programando a Lixeira Para Se Esvaziar?

1

Muitas vezes eu esqueço ou negligencio a Lixeira e a quantidade de detritos que são descartados dentro dela. Embora eu não ache que seja crítico, gostaria de saber quais opções existem que talvez estejam associadas ao Agendador de Tarefas para que a Lixeira se esvazie automaticamente, por exemplo, uma vez por semana.

    
por Simon 11.10.2013 / 21:48

2 respostas

4

A resposta que o Cyanfish postou nos comentários é excelente. Você pode usar isso sem ferramentas de terceiros:

You can effectively "empty" the Recycle Bin from the command line by permanently deleting the Recycle Bin directory on the drive that contains the system files. (In most cases, this will be the C: drive, but you shouldn't hardcode that value because it won't always be true. Instead, use the %systemdrive% environment variable.)

The reason that this tactic works is because each drive has a hidden, protected folder with the name $Recycle.bin, which is where the Recycle Bin actually stores the deleted files and folders. When this directory is deleted, Windows automatically creates a new directory.

So, to remove the directory, use the rd command (r​emove d​irectory) with the /s parameter, which indicates that all of the files and directories within the specified directory should be removed as well:

rd /s %systemdrive%\$Recycle.bin

Do note that this action will permanently delete all files and folders currently in the Recycle Bin from all user accounts. Additionally, you will (obviously) have to run the command from an elevated command prompt in order to have sufficient privileges to perform this action.

Uma alternativa estaria usando uma ferramenta de terceiros como o CCleaner que suporta a execução do prompt de comando e agendamento com o Agendador de Tarefas.

O CCleaner pode ser configurado para esvaziar a Lixeira e nada mais, e pode ser executado no horário usando o comando C:/Path/To/CCleaner.exe /AUTO

    
por 11.10.2013 / 21:55
3

De este artigo sobre TechNorms , que usa uma ferramenta de terceiros:

Download the Empty Recycle Bin ZIP file here and extract the contents somewhere recognizable.

Open “Task Scheduler” from the Start menu and create a new task from the file menu under “Action > Create Task.”

enter image description here

Name the task something identifiable and then choose the “Triggers” tab at the top.

enter image description here

Press “New” from this tab and then select “Daily” from the left side. Choose a date and time for when to run the Empty Recycle Bin task for the fist time. The task will repeat every day at the specified time.

You may also choose an option under the “Repeat task every” section to run the task every hour, but this is unnecessary for most people.

Using the same settings you can program the Task Scheduler to run once a week at a specified time.

enter image description here

Continue on be clicking “OK” and then selecting the “Actions” tab. Add a new action and ensure “Start a program” is selected for the action type. Click “Browse” to find the EmptyRecycleBin.exe file that was downloaded.

Next to the “Add arguments” section, enter the value “/Q” to ensure any prompts are suppressed while running the operation.

enter image description here

Press “OK” twice more to finish out of the open windows. The task should now be listed under the “Task Scheduler Library” in the main menu of Task Scheduler.

You can run this task outside of the defined time by right-clicking it and choosing “Run.”

enter image description here

    
por 29.11.2014 / 18:14