windows批处理常用语句

1. 查看cmd命令的帮助信息
例子: rem /?
结果:
在批处理文件或 CONFIG.SYS 里加上注解或说明。

REM [comment]

--------

cd 更改当前目录
d:
cd mp3
cd "Documents and Settings"

md 创建目录
md abc/def

rm 删除目录
rd /s temp 删除目录树并询问
rd /s/q temp 删除目录树、不询问

del 删除文件

ren 重命名
ren 1.txt 2.bat

cls 清屏

type 显示文件内容

copy 复制文件
copy 1.txt + 2.txt 3.txt合并 1.txt 和 2.txt 的内容,保存为 3.txt 文件;如果不指定 3.txt ,则保存到 1.txt

ver 系统版本

title 更改cmd标题

date/t 当前日期
time/t 当前时间

find 查找
find /i "abc" c:/test.txt查找含 abc 的行,忽略大小写

将“2016年8月29日 11:20”写入到temp.txt文件
echo 2016年8月29日 11:20>temp.txt

 

posted @ 2016-08-30 09:00  Hi!张宝  阅读(128)  评论(0编辑  收藏  举报