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

边栏推荐
- 缓存更新策略概览(Caching Strategies Overview)
- 抖音將推獨立種草App“可頌”,字節忘不掉小紅書?
- 中国白酒的5场大战
- Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
- 在最长的距离二叉树结点
- JPEG2000-Matlab源码实现
- Univariate cubic equation - relationship between root and coefficient
- PostgreSQL install GIS plug-in create extension PostGIS_ topology
- Aggregate function with key in spark
- string的底层实现
猜你喜欢

【滑动窗口】第九届蓝桥杯省赛B组:日志统计
![[Li Kou brush questions] 32 Longest valid bracket](/img/51/1ce4f9e8517dba214ec82b6567c923.png)
[Li Kou brush questions] 32 Longest valid bracket

Set up a time server

Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"

PostgreSQL install GIS plug-in create extension PostGIS_ topology

嵌入式开发的7大原罪

Persistence / caching of RDD in spark

guava:Collections. The collection created by unmodifiablexxx is not immutable

JS method to stop foreach

【力扣刷题】32. 最长有效括号
随机推荐
C语言:#if、#def和#ifndef综合应用
b站视频链接快速获取
在最长的距离二叉树结点
JS operation DOM element (I) -- six ways to obtain DOM nodes
JPEG2000-Matlab源码实现
Torch Cookbook
Forward maximum matching method
The role of applicationmaster in spark on Yan's cluster mode
In JS, string and array are converted to each other (II) -- the method of converting array into string
guava:Collections.unmodifiableXXX创建的collection并不immutable
High precision face recognition based on insightface, which can directly benchmark hongruan
First batch selected! Tencent security tianyufeng control has obtained the business security capability certification of the ICT Institute
华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
Redistemplate common collection instructions opsforlist (III)
Z function (extended KMP)
红杉中国,刚刚募资90亿美元
Sequoia China, just raised $9billion
14 years Bachelor degree, transferred to software testing, salary 13.5k
What is the RDD operator in spark
The underlying implementation of string