Solved

Best Approach for Deletion Script that Runs Nightly

Posted on 2015-02-13
3
98 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

911 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

25 Experts available now in Live!

Get 1:1 Help Now