添加youDir到用户变量:
setX PATH "%PATH%;youDir"
关于脚本变量、用户变量、系统变量。如果用set则设置的变量,只在当前脚本上有用,修改PATH也是。而用户变量和系统变量,最终会组合到一起。并且系统变量在前边
比如系统变量PATH: “C:hell0",当前用户变量PATH:”C:My"。则通过echo %PATH%看到的就是“C:hell0;C:My",则命令行查找可执行程序先从 当前目录,然后系统变量PATH,然后用户变量PATH
if判断:
@echo off
if "%2" EQU "-r" (ClipBoard D:\so\%1\release) ELSE (ClipBoard D:\so\%1\debug)
等于 equ equal
大于 gtr greater than
大于或等于 geq greater than or equal
小于 lss less than
小于或等于 leq less than or equal
不等于 neq no equal
Android过滤某个进程的log
adb logcat -v brief | find "%1"
## -v brief 是用来打进称号,然后管道符顾虑。%1是输入的第二个参数
-v后对输出的log进行格式化的参数
brief — Display priority/tag and PID of the process issuing the message (the default format).
process — Display PID only.
tag — Display the priority/tag only.
raw — Display the raw log message, with no other metadata fields.
time — Display the date, invocation time, priority/tag, and PID of the process issuing the message.
threadtime — Display the date, invocation time, priority, tag, and the PID and TID of the thread issuing the message.
long — Display all metadata fields and separate messages with blank lines.
清除文件夹和APK
@echo off
if "%1" NEQ "-k" (adb uninstall com.huawei.hwireader) ELSE (echo "hello")
adb shell rm -rf sdcard/HWiReader