批处理文件

来源:互联网 发布:nginx tomcat 真实ip 编辑:程序博客网 时间:2024/06/13 22:03

1,windows上的批处理文件

bat学习笔记

批处理文件是无格式的文本文件。在命令提示下键入批处理文件的名称,或者双击该批处理文件,系统就会调用Cmd.exe按照该文件中各个命令出现的顺序来逐个运行它们
示例:
文件名:ss.bat
文件内容

echo %1python E:\tools\ss.py %1pause

比如清理电脑上的临时文件:

@echo offecho 正在清理系统垃圾文件,请稍等......del /f /s /q %systemdrive%\*.tmpdel /f /s /q %systemdrive%\*._mpdel /f /s /q %systemdrive%\*.logdel /f /s /q %systemdrive%\*.giddel /f /s /q %systemdrive%\*.chkdel /f /s /q %systemdrive%\*.olddel /f /s /q %systemdrive%\recycled\*.*del /f /s /q %windir%\*.bakdel /f /s /q %windir%\prefetch\*.*rd /s /q %windir%\temp & md %windir%\tempdel /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 "%userprofile%\recent\*.*"echo 清理系统垃圾完成!echo. & pause 

批处理文件的循环

@echo offecho 请:apausegoto a


0 0
原创粉丝点击