且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

批处理文件未删除

更新时间:2023-12-05 19:57:04

可能是脚本有点复杂吗?也许您可以更简单地解决问题.看看下面的链接,了解我的意思.

http://scottelkin.com/programming/delete-files-older-than -date-using-batch-files/ [ http://www.computerhope.com/backup.htm [
Could it be you''re script is somewhat complicated? Maybe you could resolve the problem more simple. Have a look at the links below to see what I mean.

http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/[^]

http://www.computerhope.com/backup.htm[^]

Good luck!


这很不错,!!!!!!!!!!!
This works, Sublimely!!!!!!!!!!
@echo off 
setlocal 
for /f "delims=" %%b in ("%time%") do set "tm=%%b" 
set "tm=%tm:~0,5%" 
set "tm=%tm: =0%" 

for /f "tokens=2" %%b in ("%date%") do set "d8=%%b" 

set filespec=\*.zip \*.txt \*.jpg 
for /f "delims=" %%a in (' 
  dir %filespec% /a:-d /o:n /b /s') do ( 
    if "%%~ta"=="%d8% %tm%" ( 
     del "%%a" 
    ) 
  )