UUID要存储在文件中 [英] UUID to be stored in file

查看:165
本文介绍了UUID要存储在文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取系统的UUID并将其存储在文件中.使用命令wmic csproduct get UUID,我得到的输出文件为(UUID,然后是空格,然后是值)i.e UUID 4C4C4544-0031-5910-8048-B1C04F565331.

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.

但是我只需要在输出文件中使用值(4C4C4544-0031-5910-8048-B1C04F565331).

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

推荐答案

过滤行,您需要:

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

编辑以回复您的评论:

有一种更通用的方式来获取您想要的东西:

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

这篇关于UUID要存储在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆