Windows 7: Win 7 Pro: Need script to delete oldest file in directory
12 Oct 2012
GrouchyHermit
Windows 7 Pro 64 bit
17 posts
Win 7 Pro: Need script to delete oldest file in directory
Howdy,
I use a cloning program that automatically clones c: to e: (external drive) on a daily basis. I would like to automatically run a daily script (or something) to delete the oldest clone on the drive. I have absolutely no experience with scripting so if someone could offer simple instructions and code, or a pointer to same, it would be GREATLY appreciated.
System Manufacturer/Model Number MacBook Pro OS Windows 7 Pro 64 bit CPU 2.4 GHz Intel Core 2 Duo Memory 6 GB - 667 MHz DDR2
12 Oct 2012
edwar
7 x64
963 posts
Typically a clone of a drive to another replaces what is on the target drive with what is on the original. So if you are cloning you shouldn't have old copies/versions.
So you are not cloning, correct?
What program are you using for whatever you are doing?
Sorry, wrong terminology. It's creating a disk image of the drive. Each day, a new image. I just want to delete the oldest image each day so that there's room for a new one.
System Manufacturer/Model Number MacBook Pro OS Windows 7 Pro 64 bit CPU 2.4 GHz Intel Core 2 Duo Memory 6 GB - 667 MHz DDR2
.
12 Oct 2012
edwar
7 x64
963 posts
Ok thanks for the update. I'm not sure I have an answer for you but you may be able to setup a Batch File that will do the deleting, First, then Run the Image program. starting that batch file from a Scheduled Task.
Not sure what would be needed in the Batch file but a google search for batch file commands may help.
OS MS Windows 7 Home Premium 64-bit SP1 CPU Intel Core 2 Quad Q6600 @ 2.40GHz Motherboard ASUSTeK Computer INC. P5B-VM SE (LGA775) Memory Corsair PC2-6400 (400 MHz) 4.00 GB DDR2 Graphics Card GeForce 9600 GT 1024 MB Sound Card SB Audigy Monitor(s) Displays LG W2252 Screen Resolution 1680x1050 @ 60Hz
Keyboard Microsoft Sidewinder X6 Mouse Microsoft Sidewinder Mouse PSU Corsair HX750W Case Antec 900 Cooling Thermaltake fans Hard Drives 977GB Seagate ST31000528AS ATA Device (SATA)
488GB Seagate ST3500630AS ATA Device (SATA) Internet Speed 2 Mbps Other Info D-Link DIR-655 router
WD My Book 1.0 TB
Buffalo NAS LS-CHL v2 2 TB
13 Oct 2012
GrouchyHermit
Windows 7 Pro 64 bit
17 posts
Thanks monkeylove. I think I'll try delage32, which was mentioned at the URL that you provided.
System Manufacturer/Model Number MacBook Pro OS Windows 7 Pro 64 bit CPU 2.4 GHz Intel Core 2 Duo Memory 6 GB - 667 MHz DDR2
13 Oct 2012
GrouchyHermit
Windows 7 Pro 64 bit
17 posts
To put this to rest, I installed delage32, created a simple batch file to keep the number of images within the capacity of the drive and scheduled it to run daily. It does what I need and it saved us 45 bucks (the price of Macrium Reflect Standard, which is capable of managing disk space). Thanks to those that responded.
Last edited by GrouchyHermit; 13 Oct 2012 at 05:48 PM..