当前位置:网站首页>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判断与的功能

边栏推荐
- Explain ESM module and commonjs module in simple terms
- 039. (2.8) thoughts in the ward
- Technology sharing | packet capturing analysis TCP protocol
- The underlying implementation of string
- 麦趣尔砸了小众奶招牌
- SQL:存储过程和触发器~笔记
- Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
- Binary tree node at the longest distance
- PostgreSQL 安装gis插件 CREATE EXTENSION postgis_topology
- JS get array subscript through array content
猜你喜欢

Aggregate function with key in spark

uni-app App端半屏连续扫码

袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求

PostgreSQL 安装gis插件 CREATE EXTENSION postgis_topology

ViT论文详解

一行代码可以做些什么?

PostgreSQL install GIS plug-in create extension PostGIS_ topology

jvm:大对象在老年代的分配

Michael smashed the minority milk sign

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
随机推荐
1292_FreeROS中vTaskResume()以及xTaskResumeFromISR()的实现分析
MySQL removes duplicates according to two fields
The underlying implementation of string
Web开发小妙招:巧用ThreadLocal规避层层传值
How do I remove duplicates from the list- How to remove duplicates from a list?
Is it profitable to host an Olympic Games?
c语言char, wchar_t, char16_t, char32_t和字符集的关系
guava:Collections.unmodifiableXXX创建的collection并不immutable
Why does MySQL index fail? When do I use indexes?
爬虫实战(五):爬豆瓣top250
Redistemplate common collection instructions opsforset (V)
在Pi和Jetson nano上运行深度网络,程序被Killed
启动嵌入式间:资源有限的系统启动
Internet News: Geely officially acquired Meizu; Intensive insulin purchase was fully implemented in 31 provinces
Vit paper details
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
The relationship between root and coefficient of quadratic equation with one variable
1D convolution detail
Enhance network security of kubernetes with cilium
C how to set two columns comboboxcolumn in DataGridView to bind a secondary linkage effect of cascading events