Solved

Best Approach for Deletion Script that Runs Nightly

Posted on 2015-02-13
3
95 Views
Last Modified: 2015-05-12
Hola,

Can someone please point me in the correct direction on how to create an efficient script that will delete the following on a nightly basis?

Desktop, except RD, Chrome, etc.
Documents
Downloads
Empty Recycle Bin

This is for a communal PC where C-Suiters are prone to downloading sensitive company/employee info during meetings. They're typically Word or Excel sheets, but the file and format will be dynamic.

In order to alleviate the possibility of these items being leaked, I'd like to run script that will delete certain files, while not deleting the shortcuts that are still needed to conduct meetings.

I'd also like to empty the Recycle Bin at the end of the script.

Is this possible?

Thank you!

J
0
Comment
Question by:Ja Che
3 Comments
 
LVL 7

Expert Comment

by:CorinTack
ID: 40608368
Not to sound like I'm trying to sell a product, but a script is somewhat unreliable to accomplish what you want. The company I work for has a few clients who use Deep Freeze (http://www.faronics.com/products/deep-freeze/enterprise/) to accomplish what you're trying to do; it sets a computer at a certain state (which you determine when you install it). Each time the machine is logged off/logged on, or rebooted (again, your choice) it will clear anything that has been changed, including removing downloaded files, etc.

It works really well in the places where we use it.
0
 
LVL 23

Accepted Solution

by:
NVIT earned 500 total points
ID: 40608379
Make a .bat file with this:
rem Delete files under every User profile:
rem IMPORTANT: This deletes ALL specified files under ALL user profiles, including administrator.
pushd c:\users

rem You can add other file patterns as needed.
del /s "*.txt" "*.doc" "*.docx" "*.pdf" "*.xls" "*.xlsx"

rem Empty Recycle bin:
rd /s /q c:\$Recycle.Bin

Open in new window

To trigger the .bat, you can run it via the local policy or if you're on a domain, a GPO.

Or, since you want it to run nightly, run it via Task Scheduler, triggered to run at a certain time.
0
 

Author Comment

by:Ja Che
ID: 40609009
Thanks to both you. I'll start with the .bat file and see where I go from there. I think that's what I need, but Deep Freeze will definitely be useful in this environment.
0

Featured Post

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now