cmd命令

cmd命令

 https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/cmd

Windows常用命令 - 蓝天上的云℡ - 博客园

系统环境变量

%appdata%

C:Users<当前用户名>AppDataRoaming
 %USERPROFILE%  C:Users<当前用户名>

 @等符号的作用
https://www.jb51.net/article/32866.htm

识别的环境变量-Docs 

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 ul echo c:1 is a folder. 

if exist c:1 if not exist c:1 ul echo c:1 is a file.

删除con示例

del /f /s /q \.X:one wocon.dat

删除注册表

reg delete HKEY_LOCAL_MACHINESOFTWAREGoogleChrome 

检查并尝试修复盘 

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)
--------蓝天上的云_转载请注明出处.
原文地址:https://www.cnblogs.com/yucloud/p/6118966.html