BasicInfo
Moderator: DosItHelp
BasicInfo
Hello all,
is there somebody who can tell me/write example how to get some basic information about computer via cmd to the txt file?
I need especially CPU info, memory and from ipconfig IP addresses of all my network cards.
I supposed that it will be very easy via findstr but I was totally wrong
if I'll do:
systeminfo | findstr "Processor"
the result will be
Processor(s): 1 Processor(s) Installed.
and this is not sufficient result there should be more info
maybe I should use msinfo32 instead of systeminfo but i guess it is more complicated
many thanks for any advice and merry christmas
is there somebody who can tell me/write example how to get some basic information about computer via cmd to the txt file?
I need especially CPU info, memory and from ipconfig IP addresses of all my network cards.
I supposed that it will be very easy via findstr but I was totally wrong
if I'll do:
systeminfo | findstr "Processor"
the result will be
Processor(s): 1 Processor(s) Installed.
and this is not sufficient result there should be more info
maybe I should use msinfo32 instead of systeminfo but i guess it is more complicated
many thanks for any advice and merry christmas
Re: BasicInfo
Looll put just systeminfo that should do it.
Regards rfpd
Regards rfpd
Re: BasicInfo
definitively, but I don't need all info from systeminfo only about CPU...
Re: BasicInfo
Code: Select all
@echo off
FOR /F "skip=1 tokens=*" %%A IN ('REG.exe query
"HKEY_LOCAL_MACHINE\Hardware\Description\System
\CentralProcessor\0" /v "ProcessorNameString"') DO set "CPU=%%A"
echo %CPU%
pause
The output will show Processnamestring Reg_sz and then your cpu info, sorry i couldn't remove the part befor CPU info.
I was 30 minutes doing this
Re: BasicInfo
mischi
http://forum.oszone.net/post-1571681.html#post1571681 and after
http://forum.oszone.net/post-1571681.html#post1571681 and after
Re: BasicInfo
that will not says cpu info that he wants, watch, what he whants it's what is circuled by red.
Re: BasicInfo
rfpd: thank you very much, it works
Honestly I should read for /? more carefully after that maybe I would know about this use
Let's say that whole "command" is clear for me, only parameter /v I don't understand:(
Never mind thank you one more time for your help.
Honestly I should read for /? more carefully after that maybe I would know about this use
Let's say that whole "command" is clear for me, only parameter /v I don't understand:(
Never mind thank you one more time for your help.
Re: BasicInfo
You are welcome my friend /v means the name of the value on the regestry, by the way merry christmas and a happy new year .
Re: BasicInfo
hi guys, it's me again
I supposed that I will be able finish my bat file without help but I was totally wrong
Last informations what I need to collect via my script are IP addresses of all my network interfaces.
for example:
Network card 1: IP address
Network card 2: IP address
Network card 3: IP address
I had few ideas but everything failed because there are more NCs. Do you have any idea how to do it? For in combination with regedit can't be used like in the previous case since default route is always different!
many thanks for any idea.
I supposed that I will be able finish my bat file without help but I was totally wrong
Last informations what I need to collect via my script are IP addresses of all my network interfaces.
for example:
Network card 1: IP address
Network card 2: IP address
Network card 3: IP address
I had few ideas but everything failed because there are more NCs. Do you have any idea how to do it? For in combination with regedit can't be used like in the previous case since default route is always different!
many thanks for any idea.
Re: BasicInfo
I think IPCONFIG /ALL should display this informations.
Regards
aGerman
Regards
aGerman
-
- Posts: 79
- Joined: 13 Dec 2010 10:32
Re: BasicInfo
If you want just IP Addresses, Something like this:
Note: This probably does not account for a disconnected nic however.
Code: Select all
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
set nicnum=1
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find "IP Address"') do (
@echo Network Card !nicnum!:%%a
set /a nicnum+=1
)
Note: This probably does not account for a disconnected nic however.
-
- Posts: 79
- Joined: 13 Dec 2010 10:32
Re: BasicInfo
You may need it like this to account for both XP and 7. I do all my tests on Windows XP:
Code: Select all
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
set mynum=1
REM.-- your code goes here
echo.Hello World
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "IP Address"') do (
@echo Network Card !mynum!:%%a
set /a mynum+=1
)
for /f "tokens=2 delims=:(" %%a in ('ipconfig /all^|find /i "IPv4 Address"') do (
@echo Network Card !mynum!:%%a
set /a mynum+=1
)
-
- Posts: 319
- Joined: 12 May 2006 01:13
Re: BasicInfo
ChickenSoup wrote:You may need it like this to account for both XP and 7. I do all my tests on Windows XP:Code: Select all
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
set mynum=1
REM.-- your code goes here
echo.Hello World
for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find /i "IP Address"') do (
@echo Network Card !mynum!:%%a
set /a mynum+=1
)
for /f "tokens=2 delims=:(" %%a in ('ipconfig /all^|find /i "IPv4 Address"') do (
@echo Network Card !mynum!:%%a
set /a mynum+=1
)
there's no need to call ipconfig 2 times. Do something to the find ( or rather use findstr) to make it search for those 2 patterns at the same time.
Re: BasicInfo
ChickenSoup: thank you very much, i will take it to the office and test it, but on my home computer it is work exactly as I imagined it would.
ghostmachine4: I prefer leaving it like this, I will have to revise it a little and I more or less understand this record but I will try to follow your suggestion.
thanks one more time and Happy New Year 2011
ghostmachine4: I prefer leaving it like this, I will have to revise it a little and I more or less understand this record but I will try to follow your suggestion.
thanks one more time and Happy New Year 2011
-
- Posts: 79
- Joined: 13 Dec 2010 10:32
Re: BasicInfo
ghostmachine4 wrote:there's no need to call ipconfig 2 times. Do something to the find ( or rather use findstr) to make it search for those 2 patterns at the same time.
ghostmachine4, I'm new to using findstr. Could you present an example of the better way to do it?