Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Need a batch script or vbscript that will traverse all the users home drive directories and delete the contents of a folder inside each one.
eg
e:\users\username1\downloads
e:\users\username2\downloads
e:\users\username3\downloads
And so on
Any ideas?
Can obv do it with a log off script but I don't want to slow down the log off process, and there are some home folders on there with files in where the user is no longer logging in so would like something automated I can run on the server
[Edited on 25-09-2014 by Steve]
|
Kyle T
Premium Member
Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
|
Powershell
remove-item e:\users\*\downloads\*
Lotus Elise 111R
Impreza WRX STi
|
Kyle T
Premium Member
Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
|
Oh with a -force I think to avoid prompts?
Lotus Elise 111R
Impreza WRX STi
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
so the * i assume will just make it apply to all the sub directories?
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Script worked well, thanks
|
Kyle T
Premium Member
Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
|
Sorry, missed your last question but glad it worked.
I guess you're doing this because you've got profile redirects to a server and the downloads folders are just hogging space?
If so, you can change the profile redirect settings in group policy to exclude the Downloads, Desktop, whatever else from being redirected.
We only redirect My Documents, and users are taught to keep anything of value in there, and that content anywhere else on the computer is vulnerable to loss.
Lotus Elise 111R
Impreza WRX STi
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Yeah I want to put downloads back to being stored locally, something Il look at soon
|