|
Answer» Necessary in ACCORDANCE with deletar archives the date of creation.
Standard of the ARCHIVE: Backup_ddmmaaaa Operational system: Windows XP
Always that I will be to create a new archive, I have that to deletar oldest. How I make this for the DOS?
Since already I thank the help !
*************************************************************************
Preciso deletar arquivos de acordo com a data de criação.
Padrão do arquivo: Backup_ddmmaaaa Sistema Operacional: Windows XP
Sempre que eu for criar UM novo arquivo, preciso deletar o mais antigo. Como fazer isso pelo DOS?
DESDE já agradeço a AJUDA!The following code removes the oldest file matching the filter Backup_*.*. It look for the creation/last modification date of the file rather than for the date in the file name. But I guess it still does what you want:
Code: [Select]set obsolete= for /f "tokens=*" %%f in ('"dir /b/o-d Backup_*.*"') do set obsolete=%%f del %obsolete% Right? I go to test. Thank you!
|