UUID to be stored in file

流过昼夜 提交于 2019-12-11 13:36:18

问题


I am trying to get the UUID of the system and to store it in a file. using the command wmic csproduct get UUID I am getting the output file as (UUID some spaces then value) i.e UUID 4C4C4544-0031-5910-8048-B1C04F565331.

But I need the value alone (4C4C4544-0031-5910-8048-B1C04F565331) in my output file.


回答1:


filter the line, you need:

wmic csproduct get uuid |find "-" >file.txt

EDIT in reply to your comment:

there is a more general way to get what you want:

for /f %%i in ('wmic cpu get ProcessorID /value^|find "="') do set id=%%i


来源:https://stackoverflow.com/questions/27397689/uuid-to-be-stored-in-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!