回复 5# F_Ms - for /f "tokens=2delims=- " %%a in ('fsutil fsinfo drivetype c:') do (
- set "v=%%a"
- )
- if "%v%" == "固定驱动器" echo,OK
- pause
复制代码
- for /f "tokens=2delims=- " %%a in ('fsutil fsinfo drivetype c:') do (
- for /f %%b in ("%%a") do if "%%b" == "固定驱动器" echo,OK
- )
- pause
复制代码 其实除了fsutil,wmic也有这种情况:
C:\Windows\System32>for /f "delims=" %a in ('wmic LogicalDisk where "Name='c:'"
get Description') do echo,[%a]
] \Windows\System32>echo,[Description
]Description
] \Windows\System32>echo,[Local Fixed Disk
]Local Fixed Disk
] \Windows\System32>echo,[
]
C:\Windows\System32>
很奇怪的显示有没有? |