Link to home
Create AccountLog in
Avatar of bsharath
bsharathFlag for India

asked on

Script to het all possible hardware and software information of all machines in a txt file

Hi,

Script to het all possible hardware and software information of all machines in a txt file
I want help with 1 script that can pull all into and save in one excel file. Each machine details in one sheet or any better format that you experts can decide.

Regards
Raja
Avatar of artiomz
artiomz
Flag of Afghanistan image

You could have used systeminfo command on windows pcs.

SYSTEMINFO /S wkstn6325 /FO CSV /NH >>pcaudit.csv

this command will create a csv file with all the information of a computer wkstn6325

--artiom
this should be close to your needs.

* computerlist.txt - is a list of computer names to check

for /F %%name in (computerlist.txt) do @SYSTEMINFO /S %%name /FO CSV /NH >>pcaudit.csv

Open in new window

Avatar of bsharath

ASKER

I get this

C:\>"All details.bat"
%name was unexpected at this time.

C:\>for /F %name in (computerlist.txt) do @SYSTEMINFO /S %name /FO CSV /NH >>pca
udit.csv

C:\>
Sorry, I was wrong with a env name. This works for me:

when running from command line:
for /F %N in (computerlist.txt) do @SYSTEMINFO /S %N /FO CSV /NH >>pcaudit.csv
Is there any way to get the headers of each retrieved data
Avatar of LHT_ST
LHT_ST

try this utility from microsoft

http://technet.microsoft.com/en-us/library/bb977556.aspx

it polls all the PC's on a network (though you can specify an ip range if desired) for all sorts of information including hardware and software
you mean headers of each column?
Yes
REM please note - this will delete the present pcaudit.csv file!
REM this part will create a file with headers and details of your computer
systeminfo /fo csv > pcaudit.csv
REM this will continue the scan over the list
for /F %N in (computerlist.txt) do @SYSTEMINFO /S %N /FO CSV /NH >>pcaudit.csv
(/NH stands for No Headers)
artiomz
Thanks it works but do not get the software just get the hotfixes. Can i also get all softwares installed
ASKER CERTIFIED SOLUTION
Avatar of artiomz
artiomz
Flag of Afghanistan image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I get a txt file created in the share but not the csv
It should create another %copmutername%.txt file with programs only. You could combine these into one in excel or combining the script to one.

--artiom
In this code
ID: 34428299

Where should i put the machine names?

Also are these 2 seperate codes you gave me 1 for hardware and another for software?