Solved

Want to run a script that I can set as a weekly scheduled task to delete archived files

Posted on 2015-02-13
3
108 Views
Last Modified: 2016-06-18
I have a server which backs up relevant data to a folder. The backups are then uploaded to a remote location via the cloud. As I don't need the file after uploading to the cloud, I'd like to run a script that clears the contents of the folder and save disk space.
0
Comment
Question by:wildwilly55
[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 24

Accepted Solution

by:
NVIT earned 250 total points
ID: 40608335
Setup something like this in Task Scheduler...

General:
- Security options:
-- Pick "Run whether user logged on or not". If you are making the task on the server hosting the files, also pick "Do not store password." This will run the task as System.
-- Run with highest privileges

Triggers:
- Make a New Trigger based on desired schedule

Action:
- Program: cmd
- Add arguments: /c del /q c:\FolderOfFiles\*.*
Note: For the folder, I used c:\FolderOfFiles. Adjust the folder to your needs.
0
 
LVL 13

Assisted Solution

by:Santosh Gupta
Santosh Gupta earned 250 total points
ID: 40608701
Hi,

you can go with above suggestion, if you want to delete ALL files in folder, if you have subfolders then also add /s in parameter... i.e. - Add arguments: /c del /q /s c:\FolderOfFiles\*.*
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
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…
Six Sigma Control Plans

729 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