Home | Site Map | Cisco How ToNet How To | Wireless |Search | Forums | Services | Donations | Careers | About Us | Contact Us|

Delete old files using Windows command and batch file

Network Sharing , TCP/IP, Internet, Wireless, Exchange, IIS, ISA and Print

Delete old files using Windows command and batch file

Postby blin » Mon Sep 12, 2016 12:02 pm

Situation: The client is using SQL server backup feature to backup SQL database. Then create a batch file to move SQL backup file to an external USB drive. They would like to delete any backup files old then 14 days on the USB drive.

Re solution: they can use forfiles command.

forfiles -p "E:\usb-backup" -s -m *.* /D -15 /C "cmd /c del @path"
How to Configure and Troubleshoot Cisco
http://www.howtocisco.com

Tablet and Smartphone Setup Guide
http://www.quicksetupguide.com
blin
Site Admin
 
Posts: 3606
Joined: Wed Dec 31, 1969 7:00 pm
Location: Chicago, USA

Return to Networking

Your Ad Here

Who is online

Users browsing this forum: No registered users and 7 guests