谢谢楼上的帮助,我在dos联盟也求得一个答案,分享一下:- @echo off
- setlocal EnableDelayedExpansion
-
- for /f "tokens=1* delims=:" %%i in ('sc qc WMDrive') do (
- set "binary=%%i"
- set binary=!binary: =!
- if "!binary!"=="BINARY_PATH_NAME" (
- set "getPath=%%j"
- set getPath=!getPath:"=!
- goto show
- )
- )
- :show
- echo !getPath!
- pause
复制代码
|