当前位置:网站首页>bat脚本学习(一)
bat脚本学习(一)
2022-07-06 13:32:00 【qq_1410888563】
转载:BAT批处理文件 set命令详解_望语挽枫的博客-CSDN博客_批处理set命令
转载:BAT脚本学习篇——基本语法_Word哥的博客-CSDN博客_bat脚本基本语法
首先可以按照VScode进行脚本写入,再按照code runner进行脚本测试。vscode真的强无敌。

目录
一:打印信息 :echo

二:空一行:echo. (逗号实现空一行)

三:注释方式
:: 注释 (不显示)
rem 注释 (显示)
@ 注释 (在终端不显示,但可以执行@里面的内容,可以隐藏消息)

四:判断语句的实现
其中A代表的是空格。空格要加。
判断是否定义了一个变量

判断是否是否存在一个文件

五:建立链接

1.复制文件 :/h

2.创建文件夹快捷方法: /j
六:启动程序
格式为 : start + 空格 + 引号 +空格+ 程序目录


七:实现调用其他的bat文件
call:调用另一个批处理文件(如果不用call而直接调用别的批处理文件,那么执行完那个批处理文件后将无法返回当前文件并执行当前文件的后续命令)。
1.先为其他文件夹创建一个快捷方式
2.调用call命令执行其他的bat文件
3.为其他文件夹创建新的快捷方式

八:%cd%和%~dp0的作用
%cd% :获取当前文件的工作路径
%~dp0 : 获取当前文件的只可以用在批处理文件中,它是由它所在的批处理文件的目录位置决定的,是批处理,文件所在的盘符:+路径

九:实现if判断与的功能

边栏推荐
- What about the spectrogram
- Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
- Reptile practice (V): climbing watercress top250
- Summary of cross partition scheme
- The difference between break and continue in the for loop -- break completely end the loop & continue terminate this loop
- What can one line of code do?
- What's the best way to get TFS to output each project to its own directory?
- Efficiency tool +wps check box shows the solution to the sun problem
- 启动嵌入式间:资源有限的系统启动
- 华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
猜你喜欢

C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果

一行代码可以做些什么?

ViT论文详解

Fastjson parses JSON strings (deserialized to list, map)
![[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics](/img/2d/9a7e88fb774984d061538e3ad4a96b.png)
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics

Persistence / caching of RDD in spark

C how to set two columns comboboxcolumn in DataGridView to bind a secondary linkage effect of cascading events

爬虫实战(五):爬豆瓣top250

抖音將推獨立種草App“可頌”,字節忘不掉小紅書?

Sequoia China, just raised $9billion
随机推荐
Search map website [quadratic] [for search map, search fan, search book]
b站视频链接快速获取
R language for text mining Part4 text classification
[Digital IC manual tearing code] Verilog automatic beverage machine | topic | principle | design | simulation
Technology sharing | packet capturing analysis TCP protocol
numpy 下载安装
华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
Summary of cross partition scheme
Michael smashed the minority milk sign
基于InsightFace的高精度人脸识别,可直接对标虹软
JS method to stop foreach
麦趣尔砸了小众奶招牌
NPM run dev start project error document is not defined
Proxy and reverse proxy
中国白酒的5场大战
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
One line by line explanation of the source code of anchor free series network yolox (a total of ten articles, you can change the network at will after reading it, if you won't complain to me)
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
【力扣刷题】32. 最长有效括号
C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set