I am creating a simple script that outputs the current user logged in, CPU usage for the current system and the available memory?
I have managed to get the current user/
Firstly, when running from a batch file, the for loop variable needs two percentage symbols - %%p
%%p
Secondly, you need to echo %%p, not %p%:
%p%
for /f "skip=1" %%p in ('wmic cpu get loadpercentage') do echo %%p
From the command line:
for /f "skip=1" %p in ('wmic cpu get loadpercentage') do echo %p