本帖最后由 pcl_test 于 2016-8-14 20:34 编辑
wmic输出结果后带有的不可见字符所致,set一下就好- For /f "Delims=, tokens=2 skip=2" %%i in ('wmic os get version /FORMAT:CSV') Do set version=%%i
- echo;版本:%version%
- pause
复制代码
- For /f "tokens=2 delims==" %%i in ('wmic os get version /value^|find "="') Do set version=%%i
- echo;版本:%version%
- pause
复制代码
|