怎么写bat文件

来源:百度知道 编辑:UC知道 时间:2024/06/22 15:56:47
处理补丁
我以把补丁文件改名为1 2 3 4....
请高手帮忙!~~~

echo off
for /l %%a in (1,1,10000) do (
ren "补丁目录\*.exe" %%a.exe
)
pause

先建立txt文件,在写入你想要执行的动作.然后文件另存为时.名字随意.不过后缀改为.bat就可以了
例如制作清理小工具
写内容如下
@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 /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "