高手请进 BAT定时删除文件!
bat吧
全部回复
仅看楼主
level 2
求助一下:写一个BAT,每天定时删除D:\temp 文件夹下所有X小时前.lcd格式的文件,X是一个变量,在BAT里面可以自己改。
万分感激!
2013年04月15日 15点04分 1
level 2
没有人能帮助吗?
2013年04月16日 12点04分 3
level 6
我只会 每次开机自动删除该文件。。。。。
2013年04月19日 12点04分 4
level 6
@echo off
echo.@echo off>%systemdrive%\345.bat
echo.at 7:00 del /a /f /s /q "D:\temp\*.lcd" >>%systemdrive%\345.bat
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "1234567" /t REG_SZ /d "%systemdrive%\345.bat" >nul exit
2013年04月19日 13点04分 5
level 13
这是什么的?
2013年04月20日 02点04分 6
level 1
private void timer1_Tick(object sender, EventArgs e)
{
string[] files = Directory.GetFiles("J:\\data", "*.txt", SearchOption.AllDirectories);
foreach (string file in files)
{
string s = file;
FileInfo f = new FileInfo(s);
DateTime nowtime = DateTime.Now;
TimeSpan t = nowtime - f.CreationTime;
int day = t.Days;
if (day > 7)
{
File.Delete(s);
}
}
}
2017年02月13日 03点02分 7
level 7
@echo off
:2
if %time% ==你想要的时间,必须替换中文内容 goto 1|goto 2
:1
del D:\temp\*.icd
2017年02月13日 03点02分 8
1