corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » vbscript? help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author vbscript? help
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
25th Sep 14 at 14:48   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
25th Sep 14 at 17:33   View Garage View User's Profile U2U Member Reply With Quote

Powershell

remove-item e:\users\*\downloads\*


Lotus Elise 111R

Impreza WRX STi
Kyle T
Premium Member

Avatar

Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
25th Sep 14 at 17:33   View Garage View User's Profile U2U Member Reply With Quote

Oh with a -force I think to avoid prompts?


Lotus Elise 111R

Impreza WRX STi
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
25th Sep 14 at 18:44   View Garage View User's Profile U2U Member Reply With Quote

so the * i assume will just make it apply to all the sub directories?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
26th Sep 14 at 08:08   View Garage View User's Profile U2U Member Reply With Quote

Script worked well, thanks
Kyle T
Premium Member

Avatar

Registered: 11th Sep 04
Location: Selby, North Yorkshire
User status: Offline
26th Sep 14 at 14:43   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
26th Sep 14 at 14:54   View Garage View User's Profile U2U Member Reply With Quote

Yeah I want to put downloads back to being stored locally, something Il look at soon

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Need a bit of help (HTML) PaulW General Chat 16 1512
5th Jan 04 at 22:48
by VisibleMan
 
pc help Dan General Chat 13 733
18th Feb 05 at 15:35
by Macca_G
 
Need to convert a batch file into VBScript Richie Geek Day 6 605
18th Oct 07 at 23:05
by Richie
 
New to VB scripting Dan Lewis Geek Day 1 524
7th Jan 08 at 15:27
by Dan Lewis
 
Silent Install using VBScript kazazza Geek Day 7 751
2nd Dec 12 at 20:50
by Steve
 

Corsa Sport » Message Board » Off Day » Geek Day » vbscript? help 30 database queries in 0.0135121 seconds