Jump to content

Recommended Posts

Posted (edited)

Hi,

Just going through the server and alot of space is being taken by peoples recycle bins.

 

Ive created a logoff script

 

rmdir /s /q "\\fs1\private$\Pupil\%username%\Documents\$Recycle.Bin"
rmdir /s /q "\\fs1\private$\Pupil\%username%\Desktop\$Recycle.Bin"
rmdir /s /q "\\fs1\private$\Pupil\%username%\Downloads\$Recycle.Bin"

 

but also want to delete the ones that rarely login so made this script to run on the file server.

 

for /d %%i in (D:\Private\Pupil\*) do rd /q/s "%%i\Documents\$RECYCLE.BIN"
for /d %%i in (D:\Private\Pupil\*) do rd /q/s "%%i\Desktop\$RECYCLE.BIN"
for /d %%i in (D:\Private\Pupil\*) do rd /q/s "%%i\Downloads\$RECYCLE.BIN"
pause

 

All loook OK?

 

Having one of them days today so just want to get a second eye over it before i click the run button and schedule it for each Friday.

 

Many thanks.

Edited by DCUK6
Posted
I'm pretty sure there is an option in group policy which removed the recycle bin folder - implemented it myself sometime ago without needing a script.
Posted (edited)

Thanks ITGURU, looked at this but want to give the user a option of recovering in their current session. Just to save a few helpdesk call to recover data.

 

Update:Went for it after testing it out on only students that start with A

Seems to be ok

for /d %%i in (D:\Private\Pupil\*) do rd /q /s "%%i\Documents\$RECYCLE.BIN"

for /d %%i in (D:\Private\Pupil\*) do rd /q /s "%%i\Downloads\$RECYCLE.BIN"

for /d %%i in (D:\Private\Pupil\*) do rd /q /s "%%i\Desktop\$RECYCLE.BIN"

pause

 

Found theres also bins in my pictures, my music etc as well so will do that later.

Edited by DCUK6

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...