FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


First batch file attempt





vouge34
I want to write a batch file that will move files of a certain extension that are older than 30 days to an archive directory. For example, move all .txt files in C:\someFolder\otherFolder to D:\anotherFolder\archive that were created 30 or more days ago.

How can I get the current date to compare to the date the file was created?
How can I specify that only a certain type of file be moved?

Is this type of thing possible in a batch file or should I use something else?

Thanks for any help.
_________________
[url= http://www.shabugames.com/genres/Time_Management/index.html] time management games[/url] mortgage atlanta
eznet
I don't know if those comparisons can be made in batch files... I know I have never used a batch for those sorts of operations... You may have to use VBScript or another scripting language to get these functions...

Anyone else?
surdy
1) To tackle the date problem you can use the utility FDATE found on this page .
You can download it directly from here
Documentation for the same is here

2) you can select specific kind of files by simply using wildcard that is move only *.txt files

hope this helps
Related topics
Windows Tips&tricks!
nt set output/error file
Windows XP Tricks & Tips!!!!
A little lesson On Batch
Software to convert .bat to .exe
download a text-file daily
Automatic updating
convert batch file(bat) to .exe
Windows shortcuts, must know
Windows XP Pro (x86) on a Flash Drive.
Copying files
location of php in frih.net
Extreme Virus
My first signature making attempt in photoshop
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.