cmd命令
cmd命令
https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/cmd
%appdata% |
C:\Users\<当前用户名>\AppData\Roaming |
%USERPROFILE% |
C:\Users\<当前用户名> |
@等符号的作用
https://www.jb51.net/article/32866.htm
set 设置当前窗口进程变量
setx 永久设置系统环境变量
%~dp0 is only available within a batch file and expands to the drive letter and path in which that batch file is located (which cannot change). It is obtained from %0 which is the batch file's name.
bat批处理不关闭窗口,继续使用cmd输入
@echo off
你的命令集
cmd /k
判断是否为目录
@echo off
if exist c:\1 if exist c:\1\nul echo c:\1 is a folder.
if exist c:\1 if not exist c:\1\nul echo c:\1 is a file.
删除con示例
del /f /s /q \\.\X:\one\two\con.dat
删除注册表
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome
检查并尝试修复盘
chkdsk 盘符: /f
将 git commit id 赋值给变量
Windows
for /F %i in ('git rev-parse --short HEAD') do ( set COMMIT_SHA=%i) for /F %i in ('git describe --tags') do ( set VERSION=%i)
echo %COMMIT_SHA% echo %VERSION%
Linux
# 获得当前版本号、Commit export COMMIT_SHA=$(git rev-parse --short HEAD) export VERSION=$(git describe --tags)
--------蓝天上的云_转载请注明出处.