what cmd will give me # of CPUs and physical RAM available

  • Thread starter Thread starter Hassan
  • Start date Start date
H

Hassan

What cmd can I run in DOS that will give me the # of CPUs and speed along
with physical RAM available on the server ?
 
What cmd can I run in DOS that will give me the # of CPUs and speed along
with physical RAM available on the server ?
See tip 7913 in the 'Tips & Tricks' at http://www.jsifaq.com

Then save the following as PSR.bat in a folder in your path:

@echo off
if {%3}=={} @echo PSR numb speed memory&goto :EOF
setlocal ENABLEDELAYEDEXPANSION
set wrk="%TEMP%\info_%RANDOM%.TMP"
@echo Number of Processors Installed>%wrk%
@echo Processor 1 Speed>>%wrk%
@echo Installed Memory>>%wrk%
set /a numproc=0
set /a mhz=0
set /a ram=0
for /f "Tokens=1* Delims=:" %%a in ('compinfo^|findstr /i /g:%wrk%') do (
set key=%%a
for /f "Tokens=1" %%c in ('@echo %%b') do (
if /i "!key:~1,4!" EQU "Numb" set /a numproc=%%c
if /i "!key:~1,4!" EQU "Proc" set /a mhz=%%c
if /i "!key:~1,4!" EQU "Inst" set /a ram=%%c
)
)
endlocal&set /a %1=%numproc%&set /a %2=%mhz%&set /a %3=%ram%


Usage call PSR numb speed memory
returns the numeric environment variables numb, speed (in mega-hertz), and memory in megabytes.
 
psr 1 1 1

'compinfo' is not recognized as an internal or external command, operable
program or batch file.

I suppose I misunderstand what exactly I am supposed to use as the arguments
for this batch file.

If I used psr 1 300 512 then I already know these parameters so I don't
undersatnd the point.

--
George Hester
_______________________________
Jerold Schulman said:
See tip 7913 in the 'Tips & Tricks' at http://www.jsifaq.com

Then save the following as PSR.bat in a folder in your path:

@echo off
if {%3}=={} @echo PSR numb speed memory&goto :EOF
setlocal ENABLEDELAYEDEXPANSION
set wrk="%TEMP%\info_%RANDOM%.TMP"
@echo Number of Processors Installed>%wrk%
@echo Processor 1 Speed>>%wrk%
@echo Installed Memory>>%wrk%
set /a numproc=0
set /a mhz=0
set /a ram=0
for /f "Tokens=1* Delims=:" %%a in ('compinfo^|findstr /i /g:%wrk%') do (
set key=%%a
for /f "Tokens=1" %%c in ('@echo %%b') do (
if /i "!key:~1,4!" EQU "Numb" set /a numproc=%%c
if /i "!key:~1,4!" EQU "Proc" set /a mhz=%%c
if /i "!key:~1,4!" EQU "Inst" set /a ram=%%c
)
)
endlocal&set /a %1=%numproc%&set /a %2=%mhz%&set /a %3=%ram%


Usage call PSR numb speed memory
returns the numeric environment variables numb, speed (in mega-hertz), and
memory in megabytes.
 
Is that Perl Script ?

Also I cannot install the freeware compinfo on our production servers
without testing.

There must be some Windows command thats part of the OS that can get me that
info.. right ?

George Hester said:
psr 1 1 1

'compinfo' is not recognized as an internal or external command, operable
program or batch file.

I suppose I misunderstand what exactly I am supposed to use as the arguments
for this batch file.

If I used psr 1 300 512 then I already know these parameters so I don't
undersatnd the point.

--
George Hester
_______________________________
 
I am really surprised Jerold left us this way. He's usually very exact in
his help.

--
George Hester
_______________________________
Hassan said:
Is that Perl Script ?

Also I cannot install the freeware compinfo on our production servers
without testing.

There must be some Windows command thats part of the OS that can get me that
info.. right ?

George Hester said:
psr 1 1 1

'compinfo' is not recognized as an internal or external command, operable
program or batch file.

I suppose I misunderstand what exactly I am supposed to use as the arguments
for this batch file.

If I used psr 1 300 512 then I already know these parameters so I don't
undersatnd the point.
 
Back
Top