MajorGeeks Support Forums

Go Back   MajorGeeks Support Forums > ----------= PC, Desktop and Laptop Support =---------- > Software
Register FAQ Members List Calendar Casino Mark Forums Read

Software Software such as operating systems like Windows XP, Windows Vista, Windows 7 etc., or specific programs.


Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-06, 12:04
beetleboy's Avatar
beetleboy beetleboy is offline
Private E-2
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question batch file that will delete files by date

I am in need of some help writing a batch file that will delete files out of the specified folder. i have a folder named "backup" and within "backup" i have files that are named:
backup013106.bak
backup020106.bak
backup020206.bak
backup020306.bak
backup020406.bak
backup020506.bak
backup020606.bak
so i already have a batch file that copies the new backups into this folder and renames them by date but i would like to add to the file for it to keep only the 2 most recent backups and delete the older ones when ran. any ideas? thanks!
Reply With Quote
Sponsored links
  #2  
Old 02-08-06, 19:20
dedub dedub is offline
Corporal
 
Join Date: Feb 2005
Location: N.C.
Posts: 276
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: batch file that will delete files by date

I'm not sure if it is possible with a batch. You may have to move to .vbs script to run a more powerfull *if-than* statement. I could be wrong though.
__________________
R.L.T.W.-------A+, Net +, CCNA, VB6, JAVA, Crystal Radio
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:05.

MajorGeeks.Com Menu

MajorGeeks.Com \ All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ NEW! PC Games \ System Tools \ Macintosh \ Demonews.Com \ Top Downloads

MajorGeeks.Com \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds


All content Copyright MajorGeeks.com source code Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger