对批处理有了解的请进!

来源:百度知道 编辑:UC知道 时间:2024/06/10 11:04:27
我把Temporary Internet Files移到J:\下了,要删除Temporary Internet Files中的所有文件,下面的语句该怎么改?
还有,如果把C:\windows\temp和C:\Documents and Settings\onesavior\Local Settings\temp也移到J:\下呢,又该怎么改?
=================================================================

@echo off
echo 正在清除系统垃圾文件,请稍等 ^-^
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
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%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s

你上面批处理命令里面
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
就是删除Temporary Internet Files中的所有文件

至于把C:\windows\temp和C:\Documents and Settings\onesavior\Local Settings\temp也移到J:\
代码如下:
@echo off
md j:\temp
reg /add HKCU\Environment /v TEMP /t REG_SZ /d "j:\Temp" /f >nul
reg /add HKCU\Environment /v TMP /t REG_SZ /d "j:\Temp" /f >nul
taskill /im explorer /f
explorer
pause >nul

COPY 原目录 目标目录
目录中有空格要把目录用引号引起来,记住是英文的引号