I'm trying to get WMIC output into a variable so I can process it further.
I have made a test batch file to illustrate the problem:
wmic PROCESS where "commandline like '%%teststr%%'" get Processid,Caption,Commandlin but ´
for /F "usebackq" %%R in (`wmic PROCESS where "commandline like '%%teststr%%'" get Processid,Caption,Commandline`) do echo OUTPUT is %%R
Having called this batch I get the expected output for the first line, but invalid GET expression for the second.
Since the first line does work I think there is something wrong with my quoting - could someone please shed a light on this? I triple-checked it syntactically and it all seems correct to me according to this other question: Wmic output into variable
BB
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 300
تاريخ: پنجشنبه
30 ارديبهشت
1395 ساعت: 23:46