A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBS Script To Get PC's Information And Send To Excel



 
 
Thread Tools Display Modes
  #1  
Old July 29th 10, 09:43 PM posted to microsoft.public.windowsxp.general
undisclosed
external usenet poster
 
Posts: 488
Default VBS Script To Get PC's Information And Send To Excel


Hello all,

I found this script and it works great for one PC but I need it to pull
from a list of PC's in a text file. Can anyone help me with this?


strComputer = InputBox (\"Enter Machine Name\")



Set objExcel = CreateObject(\"Excel.Application\")

objExcel.Visible = True

objExcel.Workbooks.Add



objExcel.Cells(1, 1).Value = \"Name\"

objExcel.Cells(2, 1).Value = \"Caption\"

objExcel.Cells(3, 1).Value = \"Version\"

objExcel.Cells(4, 1).Value = \"Registered User\"

objExcel.Cells(5, 1).Value = \"Serial Number\"

objExcel.Cells(6, 1).Value = \"CSD Version\"

objExcel.Cells(7, 1).Value = \"Description\"

objExcel.Cells(8, 1).Value = \"Last Boot Up Time\"

objExcel.Cells(9, 1).Value = \"Local Date Time\"

objExcel.Cells(10, 1).Value = \"Organization\"

objExcel.Cells(11, 1).Value = \"Domain\"

objExcel.Cells(12, 1).Value = \"Manufacturer\"

objExcel.Cells(13, 1).Value = \"Model\"

objExcel.Cells(14, 1).Value = \"Number Of Processors\"

objExcel.Cells(15, 1).Value = \"Primary Owner Name\"

objExcel.Cells(16, 1).Value = \"System Type\"

objExcel.Cells(17, 1).Value = \"Total Physical Memory\"

objExcel.Cells(18, 1).Value = \"User Name\"

objExcel.Cells(19, 1).Value = \"Caption\"

objExcel.Cells(20, 1).Value = \"Manufacturer\"

objExcel.Cells(21, 1).Value = \"Name\"

objExcel.Cells(22, 1).Value = \"Release Date\"

objExcel.Cells(23, 1).Value = \"Serial Number\"

objExcel.Cells(24, 1).Value = \"SMBIOS BIOS Version\"

objExcel.Cells(25, 1).Value = \"Version\"



Set objWMIService = GetObject(\"winmgmts:\\\" & strComputer &
\"\root\cimv2\")

Set colItems = objWMIService.ExecQuery(\"Select * from
Win32_OperatingSystem\")

For Each objItem in colItems



objExcel.Cells(1, 2).Value = objItem.CSName

objExcel.Cells(2, 2).Value = objItem.Caption

objExcel.Cells(3, 2).Value = objItem.Version

objExcel.Cells(4, 2).Value = objItem.RegisteredUser

objExcel.Cells(5, 2).Value = objItem.SerialNumber

objExcel.Cells(6, 2).Value = objItem.CSDVersion

objExcel.Cells(7, 2).Value = objItem.Description

objExcel.Cells(8, 2).Value = objItem.LastBootUpTime

objExcel.Cells(9, 2).Value = objItem.LocalDateTime

objExcel.Cells(10, 2).Value = objItem.Organization

Next



Set colItems = objWMIService.ExecQuery(\"Select * from
Win32_ComputerSystem\")

For Each objItem in colItems



objExcel.Cells(11, 2).Value = objItem.Domain

objExcel.Cells(12, 2).Value = objItem.Manufacturer

objExcel.Cells(13, 2).Value = objItem.Model

objExcel.Cells(14, 2).Value = objItem.NumberOfProcessors

objExcel.Cells(15, 2).Value = objItem.PrimaryOwnerName

objExcel.Cells(16, 2).Value = objItem.SystemType

objExcel.Cells(17, 2).Value = (objItem.TotalPhysicalMemory /1024) & \"
MB\"

objExcel.Cells(18, 2).Value = objItem.UserName

Next



Set objWMIService = GetObject(\"winmgmts:\\\" & strComputer &
\"\root\cimv2\")

Set colItems = objWMIService.ExecQuery(\"Select * from Win32_BIOS\")

For Each objItem in colItems

objExcel.Cells(19, 2).Value = objItem.Caption

objExcel.Cells(20, 2).Value = objItem.Manufacturer

objExcel.Cells(21, 2).Value = objItem.Name

objExcel.Cells(22, 2).Value = objItem.ReleaseDate

objExcel.Cells(23, 2).Value = objItem.SerialNumber

objExcel.Cells(24, 2).Value = objItem.SMBIOSBIOSVersion

objExcel.Cells(25, 2).Value = objItem.Version

Next



objExcel.Range(\"A1:A25\").Select

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit



MsgBox \"Done\"


--
drewdog1977
Ads
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 04:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.