Solved

Best Approach for Deletion Script that Runs Nightly

Posted on 2015-02-13
3
110 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 24

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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

690 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