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
118 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 25

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

Technology Partners: 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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes
Suggested Courses

617 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