bat 判断变量字符串中是否包含字符串 @echo off rem way 1 set str=machine-order-service set matchStr=orderd echo %str% | findstr %matchStr% >nul && echo yes || echo no rem end way 1 pause rem way 2 setLocal EnableDelayedExpansion if not "x!str:%matchStr%=!&
在BlogJava上看到如下的批处理文件,并将其转记在此: 1 2 3 4 5 6 7 8 @echo off rem bat 获取系统时间,并去掉时间小时前面的空格 rem 2012-12-12 转自 BlogJava -"疯狂"的博客 set h=%time:~0,2% set h=%h: =0% set bak_filename=%date:~0,4%年%date:~5,2%月%date:~8,2%日%h%时%time:~3,2%分%time:~6,2%秒 echo %bak_