canyuexiaolang (vebjbr2wq)当前离线
荣誉版主
@echo off set str=c d e f g h i j k l m n o p q r s t u v w x y z echo 当前硬盘的分区有: for %%i in (%str%) do if exist %%i: echo %%i: pause复制代码
评分人数
TOP
zhouyongjun 当前离线
上校
linwhwylb 当前离线
一级士官
@echo off set str=c d e f g h i j k l m n o p q r s t u v w x y z rem 环境变量str设置了从c到z那么多个字符 echo 当前硬盘的分区有: for %%i in (%str%) do if exist %%i: echo %%i: rem %%i代表的就是环境变量str的值,用for语句则表示存在%str%就做do后面的内容 pause复制代码