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
103 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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

737 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