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
62 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
3 Comments
 
LVL 23

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
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…

758 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

17 Experts available now in Live!

Get 1:1 Help Now