For example, this code works fine
wmic MEMORYCHIP get Capacity | findstr [0-9] >> D:\ram-cpu.txt
And give memory banks capacity as output
But if I put this command in cycle
Setlocal EnableDelayedExpansion
@SET /a sl_counter=0
@FOR /F "usebackq" %%a IN (`wmic MEMORYCHIP get Capacity | findstr [0-9]`) DO (
@ECHO SLOT !sl_counter! %%a >> D:\ram-cpu.txt
@SET /a sl_counter=sl_counter+1
)
I recieve error
Unexpected: |.
D:\>@FOR /F "usebackq" %a IN (`wmic MEMORYCHIP get Capacity | findstr [0-9]`) DO
(
I guess I need some syntax to be added or fixed, but I have no idea how to do it.