最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

【服务器】定时清理C盘WindowsTemp下的文件?

常识 admin 27浏览 0评论

【服务器】定时清理C盘Windows/Temp下的文件?

如何定时清理C盘Windows/Temp下的文件?

在项目过程中,遇到Windows/Temp文件夹产生的临时文件无法删除的情况,导致过一段时间C盘就被占满,影响程序的运行,于是想到用到时任务的形式进行文件删除,找到以下命令,执行定时任务,完成!

1、在文件夹建一个定时任务bat文件
@baiecho off
echo 正在清除系统垃圾文件
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!dao
echo. & pause
2、定时任务设定

完成

【服务器】定时清理C盘Windows/Temp下的文件?

如何定时清理C盘Windows/Temp下的文件?

在项目过程中,遇到Windows/Temp文件夹产生的临时文件无法删除的情况,导致过一段时间C盘就被占满,影响程序的运行,于是想到用到时任务的形式进行文件删除,找到以下命令,执行定时任务,完成!

1、在文件夹建一个定时任务bat文件
@baiecho off
echo 正在清除系统垃圾文件
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!dao
echo. & pause
2、定时任务设定

完成

发布评论

评论列表 (0)

  1. 暂无评论