Computing.Net > Forums > Windows XP > Script to detect *.old files. how?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to detect *.old files. how?

Reply to Message Icon

Name: pkokkinis
Date: December 22, 2005 at 10:55:58 Pacific
OS: WinXPsp2
CPU/Ram: P4/1024
Comment:

I have a program on my pc that creates .old files every 2-7 days on random. I would like to move the newly created .old files so they don't get overwritten by newer .old files. Any ideas? tia. pete.



Sponsored Link
Ads by Google

Response Number 1
Name: Ed in Texas.
Date: December 23, 2005 at 02:26:30 Pacific
Reply:

pkokkinis, rather than have the script create a .old file, what would happen if you have it create a .old(x) file and increment x each time? That should create a unique file and prevent overwriting.
HTH.
Ed in Texas.


0

Response Number 2
Name: Mechanix2Go
Date: December 23, 2005 at 02:52:53 Pacific
Reply:

Hi Ed,

You think like I do.

I wrote this a few days ago. I tend to stay with 8.3 file naming. Old dog; new tricks, y'know.

::===== SEQname.bat
if exist backupC.zip ren backup.zip nackupD.zip
if exist backupB.zip ren backup.zip nackupC.zip
if exist backupA.zip ren backup.zip nackupB.zip
if not exist backupA.zip ren backup.zip backupA.zip
:: DONE

Merry Christmas


If at first you don't succeed, you're about average.

M2


0

Response Number 3
Name: pkokkinis
Date: December 24, 2005 at 20:55:28 Pacific
Reply:

very nice M2
that's exactly what i was looking for. Thanks alot and Merry Christmas to you as well!

Pete


0

Response Number 4
Name: pkokkinis
Date: December 30, 2005 at 13:27:20 Pacific
Reply:

OK, I finally got a chance to work on this before year end. Here it is for anyone interested. I like to through in a ping or two just to give the previous cmd a second breather. (there's three lines below)

if exist D:\SUPERAPP\LOGS\*.old mkdir "D:\SUPERAPP\LOGS\Archived Logs\%date:~10,4%-%date:~4,2%-%date:~7,2%\"

ping 127.0.0.1

move D:\SUPERAPP\LOGS\*.old "D:\SUPERAPP\LOGS\Archived Logs\%date:~10,4%-%date:~4,2%-%date:~7,2%\"


0

Response Number 5
Name: Mechanix2Go
Date: December 30, 2005 at 18:41:51 Pacific
Reply:

That should work.


If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Direct3d 7 interface prob... Trying to get back up and...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Script to detect *.old files. how?

Compressing Old Files (How do I?) www.computing.net/answers/windows-xp/compressing-old-files-how-do-i/91566.html

Anyway to uncompress old files www.computing.net/answers/windows-xp/anyway-to-uncompress-old-files/91700.html

deleting old files www.computing.net/answers/windows-xp/deleting-old-files/149407.html