0
我试图获取WMIC命令的输出以将变量分配给每一行。来自txt文件的wmic变量
我试图让出来放到这个样子:
1第一程序安装的
2秒程序安装的
3第三程序安装的安装
4第四种方案
5 ...等
@Echo off
wmic /output:file.txt product get name /format:csv
rem wmic product get name
@Echo Off
SetLocal EnableDelayedExpansion
Set n=
Set _InputFile=c:\users\jorge\desktop\file.txt
For /F "tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)
:: This line will display the variables just assigned
:: For testing only, delete when not needed
Set _
EndLocal
pause