[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What code would I use in a cmd file to delete specific backup files?

Posted on 2011-05-10
7
Medium Priority
?
517 Views
Last Modified: 2012-05-11
I have set up  task manager in Windows Server 2008 R2 to back up an Access 2007 DB  every hour, 12 hours/day, every week day.
These files are saved as  .accdb files in  F:\xyz

I need to write a .cmd file that will be triggered by task manager once a day to delete all .accdb files in F:\xyz that are  >  1 day old.
Thanks
0
Comment
Question by:PDSWSS
7 Comments
 
LVL 21
ID: 35733795
0
 
LVL 59

Expert Comment

by:Bill Prew
ID: 35734269
If you don't mind using a small free command line utility, take a look at DELAGE32:

http://home.mnet-online.de/horst.muc/win/delage.htm
http://home.mnet-online.de/horst.muc/wbat32.htm

~bp
0
 

Author Comment

by:PDSWSS
ID: 35743253
TheHiTechCoach:
Any reason (SECURITY) not to set ExecutionPolicy in Windows Powershell to Remote Signed- Thanks
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Assisted Solution

by:PDSWSS
PDSWSS earned 0 total points
ID: 35760636
I was not clear enough in my question. I need to delete the folders that contain the backup files not just the files.  Thanks
0
 

Accepted Solution

by:
PDSWSS earned 0 total points
ID: 35760675
0
 
LVL 2

Expert Comment

by:hari_b85
ID: 35800407
A simple way might be moving the older files to a new folder and then deleting them, for example,

--------------------------------------------------------------------------------------------------------------------
@Echo off
cls
md F:\xyz\Olderfiles
robocopy "F:\xyz" "F:\xyz\Olderfiles" *.accdb /e /v /r:2 /w:0 /mov /MINAGE:1
RD /S /Q "F:\xyz\Olderfiles"
0
 

Author Closing Comment

by:PDSWSS
ID: 35865629
None of the answers provided by the experts answered the question as I needed it to be answered. Therefore, I reposted and made it clearer what I was looking for. I received an excellent answer in the repost. Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

831 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