Page 1 of 1

[SOLVED] Recycle Bin Cleaning and Scheduled Tasks

Published: September 27, 2017 - 2:24 PM
by Matthew
Good morning,

In my school, we have tablets running Windows 8.1 connected to the domain. Therefore, each student must log in with a username and password.
User accounts are deleted every 7 days when Windows starts.
However, this cleanup isn't working properly, and the recycle bins aren't actually emptied ($Recycle.bin grows very quickly). The same goes for the Windows\Temp folder (which contains remnants of wapt package installations, for example). I've also noticed the accumulation of scheduled tasks specific to each user (User_Feed_Synchronization-{...}, SqmUpload_S-1-5-21-..., Optimize Start Menu Cache Files-S-1-5-21-...).
I considered creating a scheduled task to empty the recycle bin using the command

Code: Select all

rd /s /q %SystemDrive%\$Recycle.bin
but I couldn't get it to work.

Do you have any ideas about these problems?

I would like to deploy the solution via a wapt package of course which would clean all this up on each reboot given that I have 90 tablets to process before the disk becomes full.

Thank you in advance for your advice

Matthew

Re: Cleaning the Trash and Scheduled Tasks

Published: March 2, 2018 - 7:49 PM
by dcardon
Good evening Matthieu,
Matthieu wrote: September 27, 2017 - 2:24 PM Good morning,

In my school, we have tablets running Windows 8.1 connected to the domain. Therefore, each student must log in with a username and password.
User accounts are deleted every 7 days when Windows starts.
However, this cleanup isn't working properly, and the recycle bins aren't actually emptied ($Recycle.bin grows very quickly). The same goes for the Windows\Temp folder (which contains remnants of wapt package installations, for example). I've also noticed the accumulation of scheduled tasks specific to each user (User_Feed_Synchronization-{...}, SqmUpload_S-1-5-21-..., Optimize Start Menu Cache Files-S-1-5-21-...).
I considered creating a scheduled task to empty the recycle bin using the command

Code: Select all

rd /s /q %SystemDrive%\$Recycle.bin
but I couldn't get it to work.

Do you have any ideas about these problems?

I would like to deploy the solution via a wapt package of course which would clean all this up on each reboot given that I have 90 tablets to process before the disk becomes full.
(Sorry for the necro-posting, I'm going through unanswered topics to clean up the forum in preparation for the WAPT 1.5 release)

For the $Recycle.bin directory, I think it's best to delete the subdirectories rd c:\$Recycle.bin\*\*.*

For the scheduled task configuration, the best way is to create the task (be careful to launch it in Local System to ensure you have the deletion rights), and schedule it for the desired time, then export it as XML.
Then the task can be imported via a WAPT package or other method using the command line
schtasks /create /tn "cleanup" /xml cleanuptask.xml

Sincerely,

Denis