Saved Bookmarks
| 1. |
Solve : Machine Spec. help.? |
|
Answer» I have been tasked with obtaining some INFORMATION about the PC's in my building. i have 100 pc's and i wish to determine the following. I have been tasked with obtaining some information about the PC's in my building.Hmmm....What Building?lol, sounds a bit dodgy. Basically, i'm a CAD manager and i am trying to asses what my mchine SPECS are for my cad operators, as i may need to upgrade some of them. Just trying to get a feel for what i have. FYI. here is a batch file a student here figured out for me. There is a start up batch for each user i will just call up the batch tomorrow, and assuming you log off tonight your'll be picked up. I will hope to tell the batch to write to a location on the network. Thanks for the help though. Diarmuid ******************* ECHO OFF systeminfo.exe > temp.txt ECHO OFF find "Host Name:" < temp.txt> %ComputerName%.txt find "Processor(s):" < temp.txt>> %ComputerName%.txt find "Total Physical Memory:" < temp.txt>> %ComputerName%.txt find "Virtual Memory:" < temp.txt>> %ComputerName%.txt find "Domain:" < temp.txt>> %ComputerName%.txt find "Logon Server:" < temp.txt>> %ComputerName%.txt ECHO OFF del temp.txt clsI do the same THING but have the luxury of being able to be in windows XP to be able to quality control the systems. I started out with BAT and moved on to scripts that can pull information directly from the windows API with out having to parse info or call on other windows programs using start/call etc. Though I do have some machines that do not have an OS installed, I check the BIOS for time date ram/cpu etc But to give you the degree of quality control we require, I have to check every aspect of the system from
I later wrote a complete WScript File (.wsf) to be able to do all of these cutting QC time down to 5 mins, All the tech has to do manually now, is check the screws are in the right places... Here's a javascript example Copy PASTE it in Notepad rename it as Spec.js The code can be setup to run remotely, or sent back to you as txt file etc. Pretty much anything you can do on your PC you can access it via script, simply search google for msdn WMI tasks Code: [Select]var wbemFlagReturnImmediately=0x10; var wbemFlagForwardOnly=0x20; var jsCrLf=String.fromCharCode(13, 10); var jsQuote=String.fromCharCode(34); //Windows Management Interface function wmiCon(strComp){ try{ var objWMIService = GetObject( "winmgmts://"+ strComp +"/root/cimv2" ); } catch(error){ var strMsg = jsCrLf + "WMI Connection Error # " + error + jsCrLf; WScript.Echo(strMsg); WScript.Quit(0); } return objWMIService; } function wmiSQL(wmiBase){ var objWMIService = wmiCon("."); try{ var colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_" + wmiBase, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly ); //query } catch(error){ var strMsg = jsCrLf + "WMI Query Error # " + error + jsCrLf; WScript.Echo(strMsg); WScript.Quit(0); } objWMIService.close; return colItems; } var strMemTotal,strHostName,strDomain,strCpuCount, strCPUSpeed = "", strToAdd = "" var colItems = wmiSQL("Processor"); var enumItems = new Enumerator(colItems); for (x=0 ; !enumItems.atEnd(); enumItems.moveNext()) { var objItem = enumItems.item(); if (x >= 1){strToAdd = ", " + x + ") "} else{strToAdd = String(x + ") ")} strCPUSpeed += strToAdd + objItem.MaxClockSpeed(x) + " MHz"; x++; } var colItems = wmiSQL("ComputerSystem"); var enumItems = new Enumerator(colItems); for (x=0 ; !enumItems.atEnd(); enumItems.moveNext()){ objItem = enumItems.item(); strMemTotal = objItem.TotalPhysicalMemory; strHostName = objItem.Name; strDomain = objItem.Domain; strCpuCount = objItem.NumberOfProcessors; x++; } strMemTotal = strMemTotal / 1048576; strMemTotal = Math.round(strMemTotal); var strSaveto = "C:\\" + strHostName + ".txt" var strSysInfo = "HostName: " + strHostName + "\nDomain: " + strDomain + "\nCPU Count: " + strCpuCount + "\nCPU Speed: " + strCPUSpeed + "\nMemory: " + strMemTotal + " MBs"; WScript.Echo(strSysInfo + "\n\nResults Saved to " + strSaveto); var fso, f var ForReading=1, ForWritting=2, ForAppending=8; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.OpenTextFile(strSaveto, ForWritting, true); var strToReplace = /\n/g; //g - global, i - case insensitive, m - multiline search strSysInfo = strSysInfo.replace(strToReplace, jsCrLf); f.write(strSysInfo); f.close(); fso.close; |
|