That worked, excelent. I actualy had it typed right before except I can't get the variable for the number of processors. I am also trying to to retrieve information when I run it with the /d (which is drive space). This one is pretty confusing, I am trying different token varibles. Here is what I have so far after some editing.
@echo off
for /F "tokens=2* delims=:. " %%a in ('psinfo ^| find /I "Processor speed"') do set proc=%%b
for /F "tokens=2* delims=:. " %%c in ('psinfo ^| find /I "Physical memory"') do set mem=%%d
for /F "tokens=1* delims=:. " %%e in ('psinfo /d ^| find /I "c:"') do set dspace=%%f
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%, %dpace%>> "C:\sp.txt"
still tinkering with the delim values.
Main Topics
Browse All Topics





by: oBdAPosted on 2004-04-06 at 09:23:25ID: 10767333
Try this:
@echo off
for /f "tokens=2* delims=:. " %%a in ('psinfo ^| find /i "Processor speed"') do set proc=%%b
echo %USERNAME%, %DATE%, %TIME%, %COMPUTERNAME%, %proc%>> "C:\sp.txt"
Note that the string to look for is "Processor speed", not "Processors speed".
The "tokens" definition means that the for command should extract the second token and put it into %%a (which will be ignored), all subsequent tokens (*) should be put into %%b.