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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

856 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