Hi aGerman,
Thanks a lot for your help.
Your script is working absolutely fine for me.
I really appreciate your help.
Best Regards,
Vikky_Vik
-----------------
Hi squashman,
Thanks a lot for your help also. I really appreciate your help also.
Best Regards,
Vikky_Vik
delete 2 days older folders
Moderator: DosItHelp
Re: delete 2 days older folders
1. http://blog.naver.com/mokomoji/130117861406 - D-daY 100% calculation
2. http://blog.naver.com/mokomoji/130029578178 - week
Mon Tue Wed Thu Fri Sat Sun
file make day - to 2 week day
today monday - 2day = satday
max day 6day delete
3. windows server type command
2 line command end
@echo off
FORFILES /D -2 /m filesname
exsemple
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c del D:\backup\WEB_SOURCE\2010\@file"
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c rmdir /s /q D:\backup\WEB_SOURCE\2010\@file"
2. http://blog.naver.com/mokomoji/130029578178 - week
Mon Tue Wed Thu Fri Sat Sun
file make day - to 2 week day
today monday - 2day = satday
max day 6day delete
3. windows server type command
2 line command end
@echo off
FORFILES /D -2 /m filesname
exsemple
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c del D:\backup\WEB_SOURCE\2010\@file"
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c rmdir /s /q D:\backup\WEB_SOURCE\2010\@file"
Re: delete 2 days older folders
mokomoji wrote:1. http://blog.naver.com/mokomoji/130117861406 - D-daY 100% calculation
2. http://blog.naver.com/mokomoji/130029578178 - week
Mon Tue Wed Thu Fri Sat Sun
file make day - to 2 week day
today monday - 2day = satday
max day 6day delete
3. windows server type command
2 line command end
@echo off
FORFILES /D -2 /m filesname
exsemple
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c del D:\backup\WEB_SOURCE\2010\@file"
forfiles /P D:\backup\WEB_SOURCE\2010\ /D -7 /C "cmd /c rmdir /s /q D:\backup\WEB_SOURCE\2010\@file"
While I did mention FORFILES in my 1st post the user did not reply to whether they had FORFILES on all their computers. It is not native to XP but technically can be installed on XP.
Your solution also does not take into account the pattern matching for the beginning of the file name. Don't think the /M switch can take a regular expression. It needs to account for multiple days.
Forfiles is one of my favorite utilities though for deleting files older than so many days.
-
- Posts: 1
- Joined: 10 Jan 2012 17:35
Re: delete 2 days older folders
Don't mean to hijack this thread, but I want to do something similar. I want to copy all of the files created yesterday in 'folder A' to 'folder B'. I look at the code presented here and my head swims. Anyone know the command(s) to do this?