?
Solved

Best Approach for Deletion Script that Runs Nightly

Posted on 2015-02-13
3
Medium Priority
?
117 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 25

Accepted Solution

by:
NVIT earned 2000 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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

764 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