批处理【珍藏】批处理常用指令([collection] common instructions for batch processing)

批处理for  时间:2021-03-25  阅读:()

【珍藏】批处理常用指令 [collection] common instructions forbatch processing

BAT command Daquan

@ # single back off

Echo off # began to close back from the next line

@echo off#began to close back from the bank. This is the firstline of general batch processing

Echo on # began to open to the next line

Echo echo off is # displays the current state or echo state onEcho. # output a blank line, "enter"

# (echo, echo; echo+ echo[echo] echo/ echo\)

2 errorlevel

Echo%errorlevel%

Each command is run and you can view the return code in thiscommand line format

The default value is 0, and the general command error is setto errorlevel 1

3 dir

Dir#displays the current directory files and subdirectories.Dir /a # display in the current directory files andsubdirectories, including hidden and system files

Dir c: /a:d # display C in the current directory directoryDir c: /a:-d # display root directory C files

Dir c:\/b/p#/b displays only the file name, and the /p pagingdisplay

Dir *.exe /s # display the current directory and all thesubdirectories.Exe file

4 CD

Cd\ # into the root directory

CD # displays the current directory

CD /d d:\sdk # can also change the drive and directory5 MD

MD d:\a\b\c # if d:\a does not exist, it will automaticallycreate the intermediate directory

If # command extensions are disabled, you need to type MKDIR\a\b\c.

6 Rd

Rd ABC# delete the current directory ABC directory, for emptydirectory

Rd/s/q d:\temp# delete the d:\temp folder and subfolders andfiles, /q quiet mode

7 del

Del d:\test.txt # deletefile, cannot be hidden, and read-onlyfile system

Del /q/a/f d:\temp\*.*

Delete all files inside the d:\temp folder, including hidden,read-only, system files, not subdirectories

Del /q/a/f/s d:\temp\*.*

Delete all files in the d:\temp and subfolders, includinghidden, read-only, system files, not subdirectories

8 Ren

Ren d:\temp TMP # support to rename folder

9 CLS

Clear the screen

10 type

Display file contents

Type c:\boot. ini#displays the contents of the specified file,the program files usually garbled

Type *. txt # display all.Txt files in the current directorycontents

11 copy

Copy file

Copy c:\test. txt d:\test.bak

Copy the c:\test.txt file to d:\ and rename it to test.bakCopy con test.txt

From the screen, wait for the input, press Ctrl+Z to end theinput, and save the input as a test. txt file

Con stands for screen, PRN stands for printer, and nul standsfor empty device

Copy 1. txt + 2.txt 3.txt

Merge the contents of 1.txt and 2. txt and save it as a 3.txtfile

If no 3.txt is specified, then save to 1.txt

Copy test. txt +

Copying files to themselves is actuallymodifying the file date12 title

Set the title of the CMD window

Title New Title # CMD can see the title bar of the windowchanged.

13 ver

Display system version

14 label and Vol

Set the label

Vol # display label

Label # display label, also prompted the new label

Label c:system # set C label for system

15 pause

Pause command

16 REM and: :

Comment command

The comment line does not perform the operation

17 date and time

Date and time

Date#displays the current date, and prompted a new input date,press "enter" skip

Date/t#only displays the current date, not prompt the new dateTime # displays the current time, and prompt new input time,press "enter" skip

Time/t # only display the current time, not prompted to entera new time

18 goto and:

Jump command

Label: the # said it is tag line, the tag line does not performthe operation

Goto label # jump to the specified label that line

19 find (external command)

Find command

Find \ \ "abc\" c:\test.txt

Find the line containing theABC string in the c:\test.txt fileIf not found, the errorlevel return code is set to 1

Find /i, "ABC", c:\test.txt

Find rows containing ABC, ignore case

"Find /c \" "abc\" c:\test.txt

Shows the number of rows containing ABC

20 more (external command)

Screen by screen display

More c:\test. txt # by screen display c:\test. txt file content21 tree

Display directory structure

Tree d:\ # display D disk file directory structure

22 &

Execute multiple commands in sequence, regardless of whetherthe command succeeds

23 & &

Execute multiple commands in sequence, and do not execute thefollowing command when the command that executes the error isencountered

Find "ok\" c:\test. txt & & echo

If the word "ok\" is found, it is shown "success" and cannotbe found if it is not found

24 | |

Execute multiple commands in sequence, and do not execute thefollowing command when the correct command is encounteredFind "ok\" c:\test. txt echo | | unsuccessful

If the word "ok\" is not found, it is shown "unsuccessful \"and is not displayed when it is found

25 |

Pipe command

Dir /s/a find /c. * | \ ".Exe\"

The pipe command indicates that the dir command is executedfirst, and the subsequent find command is executed for theoutput of the command

The command line results: output the number of.Exe files in thecurrent folder and all subfolders

Type c:\test. txt|more

This is the same effect as the more c:\test.txt

26 > an d

Output redirection command

> purge the original contents of the file before writing themAppend content to the end of the file without removing theoriginal content

The main contents of the original display on the screen isoutput to the specified file

If the specified file does not exist, the file is automaticallygenerated

Type c:\test. txt >prn

The file content is not displayed on the screen, and the outputis turned to the printer

bgpto:BGP促销,日本日本服务器6.5折$93/月低至6.5折、$93/月

bgpto怎么样?bgp.to日本机房、新加坡机房的独立服务器在搞特价促销,日本独立服务器低至6.5折优惠,新加坡独立服务器低至7.5折优惠,所有优惠都是循环的,终身不涨价。服务器不限制流量,支持升级带宽,免费支持Linux和Windows server中文版(还包括Windows 10). 特色:自动部署,无需人工干预,用户可以在后台自己重装系统、重启、关机等操作!bgpto主打日本(东京、大阪...

昔日数据:香港云服务器(2G防御)、湖北云服务器(100G防御),首月5折,低至12元/月

昔日数据,国内商家,成立于2020年,主要销售湖北十堰和香港HKBN的云服务器,采用KVM虚拟化技术构架,不限制流量。当前夏季促销活动,全部首月5折促销,活动截止于8月11日。官方网站:https://www.xrapi.cn/5折优惠码:XR2021湖北十堰云服务器托管于湖北十堰市IDC数据中心,母鸡采用e5 2651v2,SSD MLC企业硬盘、 rdid5阵列为数据护航,100G高防,超出防...

[6.18]IMIDC:香港/台湾服务器月付30美元起,日本/俄罗斯服务器月付49美元起

IMIDC发布了6.18大促销活动,针对香港、台湾、日本和莫斯科独立服务器提供特别优惠价格最低月付30美元起。IMIDC名为彩虹数据(Rainbow Cloud),是一家香港本土运营商,全线产品自营,自有IP网络资源等,提供的产品包括VPS主机、独立服务器、站群独立服务器等,数据中心区域包括香港、日本、台湾、美国和南非等地机房,CN2网络直连到中国大陆。香港服务器   $39/...

批处理for为你推荐
申请表在线代理internalservererrorHTTP/1.1500Internal Server Error.怎么办呐在线代理怎么样设置代理,让别人看我的IP是别的地方,不是我真实的IP?开启javascript怎样打开JavaScript?360邮箱360免费申请邮箱在那里重庆400年老树穿楼生长重庆海拔500左右的红沙土适合栽哪种果树特朗普吐槽iPhone华为余承东吐槽iPhone X,除了贵啥优点都没有曲目ios滴滴估值500亿滴滴流水每天280元一个月下来能赚 多少泉州商标注册泉州注册一个商标具体要怎么弄?具体流程是什么?
手机网站空间 如何申请域名 香港主机 京东云擎 河南m值兑换 最好的qq空间 东莞服务器 能外链的相册 免费网页空间 无限流量 万网空间管理 架设邮件服务器 免费ftp 域名和主机 apnic 深圳主机托管 锐速 香港ip 建站技术 godaddy退款 更多