freesoft00 当前离线
六级士官
C:\ D:\ E:\ F:\ K:\复制代码
评分人数
bailong360 (zhonghua)当前离线
上尉
@Echo Off For /F "Delims=: " %%i in ('mountvol^|find ":\"') Do If Not "%%i:"=="%~d0" Set /P =%%i <nul Echo; For /F "Delims=: " %%i in ('mountvol^|find ":\"') Do If Not "%%i:"=="%~d0" Echo %%i复制代码
TOP
pcl_test 当前在线
荣誉版主
@echo off setlocal enabledelayedexpansion set "str=CDEFGHIJKLMNOPQRSTUVWXYZ" for /f "tokens=1* delims=: " %%a in ('mountvol^|find ":\"') do set "s=!s!%%a " echo,!s! for %%i in (!s!) do set "str=!str:%%i=!" echo !str:~,1! pause复制代码
驱动器: C:\: D:\ E:\ F:\复制代码
@echo off setlocal enabledelayedexpansion for /f "tokens=1*" %%a in ('fsutil fsinfo drives ^|find ":\"') do ( for %%i in (%%b) do set a=%%i & echo format !a:~,2! ) pause复制代码
@echo off setlocal enabledelayedexpansion for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do ( set var=%%i set drive=!var:~-2! fsutil fsinfo drivetype !drive!|find "驱动器">nul&& echo !drive! ) pause复制代码
@Echo Off For /F "Skip=1" %%i In ('Wmic LogicalDisk Where DriveType^="3" Get Caption') Do Echo Format %%i复制代码