Sign in to follow this  
Followers 0
Neato

Inventory

8 posts in this topic

Hi,

I need some help to make a script for inventory of a computer.

Any information from a computer, like:

Username

Username Describtion

Computername

S/N

RAM

Model of the computer

CPU and speed

OS

and what kinds of program there is installed.

Thx very much.

/Neato

Share this post


Link to post
Share on other sites



I am sure i've seen ppl posting ideas on the very subject before.

Best bet is to seatch the forum for ideas... :lmao:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

and what kinds of program there is installed.

<{POST_SNAPBACK}>

You'll have to read the registry for that. Most programs would be located under the "Uninstall" registry key....except for those of us that can add programs to the computer without actually using the install function. :lmao:

Username

Username Describtion

Computername

S/N

RAM

Model of the computer

CPU and speed

OS

On NT/Win2k/WinXP systems, some of this information can be obtained though a "SET" command at the command line. Other ways are through the use of the built in @variables in AutoIt. Look in the help file under "@"

For the rest of it, follow JdeB's advice.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I am sure i've seen ppl posting ideas on the very subject before.

Best bet is to seatch the forum for ideas...  o:)

<{POST_SNAPBACK}>

I have tried to do a search, but with no luck. :lmao:

I have a script, but I can't find a solution on the S/N and what computer it is. For exampel, is it a desktop or laptop and what brand ect.

Edited by Neato

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Any information from a computer, like:

Username  @UserName

Username Describtion (Need to use a third part program to access AD)

Computername @ComputerName

S/N (Not stored in Windows so need third party software)

RAM ....

Model of the computer ....

CPU and speed ....

OS  @OSType or @OSVersion

and what kinds of program there is installed. (C:\Program Files\*.)

Thx very much.

/Neato

Do a listing of the directories on the root of C:\Program Files\ . That should give you a quick and dirty listing of most of the programs installed. If you want something more than that then you will need to dig a lot deeper. Also double check your search. This has been done already. I even wrote one. The Ser# and Model Type is tough. I haven't figured out that part either

http://www.autoitscript.com/forum/index.php?showtopic=7371 Look down the thread and you will see my script.

Edited by tazdev

Share this post


Link to post
Share on other sites

The Ser# and Model Type is tough. I haven't figured out that part either

I found Hey, Scripting Guy! on microsoft.com. It can be really useful ! The VBS scripts work as is ! :lmao:

Cervélo Soloist 2004 & Cervélo P3C 2007

Share this post


Link to post
Share on other sites

Although Neato has found another solution for his issue, I thought I'd post a UDF that I use to get the System Model information for those who might be following the thread. It's a bit crude, and is meant for W2K which does not have a command line WMI capability like XP. If anyone has a better way of doing this, please post your code.

Func SystemModel()
;Returns the global variable $sm for the System Model 
If FileExists(@CommonFilesDir & "\Microsoft Shared\MSInfo\msinfo32.exe") Then
   Global $sm
   Dim $line, $smo, $wmi
   RunWait('"' & @CommonFilesDir & '\Microsoft Shared\MSInfo\msinfo32.exe" /categories +systemsummary /report ' & @TempDir & '\sum.txt')
  ;Line below parses UniCode to ASCII
   RunWait(@ComSpec & ' /c type ' & @TempDir & '\sum.txt>' & @TempDir & '\sum1.txt', '', @SW_HIDE)
   $wmi = FileOpen(@TempDir & '\sum1.txt', 0)
   If $wmi = -1 Then Exit (1)
   While 1
      $line = FileReadLine($wmi)
      If @error = -1 Then ExitLoop
      $smo = StringInStr($line, 'System Model')
      If $smo <> 0 Then
         $sm = StringStripWS(StringReplace($line, 'System Model', ''), 3)
         ExitLoop
      EndIf
   WEnd
   FileClose($wmi)
   Sleep(1000)
   FileDelete(@TempDir & '\sum.txt')
   FileDelete(@TempDir & '\sum1.txt')
EndIf
EndFunc

Fully automatic, comes in any sizeMakes me wonder what I did before I got synchronized...

Share this post


Link to post
Share on other sites

Hi there,

this is my first post and I hope it helps.

You can try something like that: RunWait(@ComSpec & " /c " & "systeminfo > %temp%\sysinfo.txt",@SW_HIDE)

From that file you can then extract the info you want and delete it at the end of the script.

For the serial number I have one vb script that I used inside the autoit:

RunWait(@ComSpec & " /c " & "cscript %temp%\SerialNo.vbs > %temp%\serialno.txt",@SW_HIDE)

Code of the vbs:

On Error Resume Next

strComputer = "."

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

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

For Each objItem in colItems

Wscript.Echo "SerialNumber: " & objItem.SerialNumber

Next

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0