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


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.

LVL 11
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

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

bsharathAuthor Commented:
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

JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

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
bsharathAuthor Commented:
Is there any way to get the headers of each retrieved data
try this utility from microsoft

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?
bsharathAuthor Commented:
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)
bsharathAuthor Commented:
Thanks it works but do not get the software just get the hotfixes. Can i also get all softwares installed
I don't think there is a ready tool for that. You can try putting the following into the for loop too (replacing \\server\share to %N variable).  This will put the installed software to another file.

     @echo off
     set destination=\\server\share
     %comspec% /e:2048/c for %%v in (1 2) do prompt set {date}$q$d$_ |  find/v "$" >{t}.bat
     for %%v in (call del) do %%v {t}.bat
     echo %{date}% - Installed applications registered on %computername%: >> %destination%\%computername%.apps.txt
     echo. >> %destination%\%computername%.apps.txt
     start /wait regedit /e %temp%.\~tmp HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
     find "DisplayName" < %temp%.\~tmp | find /v "QuietDisplayName" >> %destination%\%computername%.apps.txt
    del %temp%.\~tmp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bsharathAuthor Commented:
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.

bsharathAuthor Commented:
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?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.