Page 1 of 1 1
Topic Options
#143913 - 2005-07-20 05:11 AM Computer Inventory - Mailed to Admin
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Here is a slightly modified version of the inventory script from this post.
My Computer Info - for Help Desk use PART 4

It uses BLAT to e-mail the completed htm file to an Administrator silently

The script can be downloaded from here. Requires KiXtart 4.22 or newer
inventory.kix

 

Top
#143914 - 2005-07-20 05:21 AM Re: Computer Inventory - Mailed to Admin
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what is that floating point number labeled "free space"?
_________________________
!

download KiXnet

Top
#143915 - 2005-07-20 05:26 AM Re: Computer Inventory - Mailed to Admin
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
I did not specify a drive, so it becomes

$drive='%WINDIR%'


Code:
Function DiskSpace(optional $drive,$format)
Dim $objWMIService, $sWQL, $colDrives, $objDrive
If Not $drive
$drive='%WINDIR%'
EndIf
$format=Val($format)
If $format<5
$format=IIf($format=1,1024,IIf($format=2,1024.0*1024,IIf($format=3,1024.0*1024*1024,IIf($format=4,1024.0*1024*1024*1024,1))))
$diskspace=Cdbl(GetDiskSpace($drive))/$format
Else
$objWMIService=GetObject('WinMgmts:root/cimv2')
$sWQL = "Select Size, FreeSpace FROM Win32_LogicalDisk WHERE Name='"+Left($drive,2)+"'"
$colDrives=$objWMIService.ExecQuery($sWQL)
For Each $objDrive in $colDrives
$diskspace=Cdbl($objDrive.FreeSpace)/Cdbl($objDrive.Size)*100
Next
EndIf
$objWMIService=0
Exit @ERROR
EndFunction


 


Edited by NTDOC (2005-07-20 05:27 AM)

Top
#143916 - 2005-09-24 07:41 AM Re: Computer Inventory - Mailed to Admin
2manyhats Offline
Fresh Scripter

Registered: 2005-09-07
Posts: 33
Not trying to hijaak this topic but posting something like this to a csv on a network share would be awsome. Something that would overwrite the same lines in the csv from the same computer name. Kinda like log info by RJL software. Just know this would be helpful to a lot of people. Your work looks awsome.

Edited by 2manyhats (2005-09-24 07:42 AM)

Top
#143917 - 2005-09-24 11:59 AM Re: Computer Inventory - Mailed to Admin
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doc, I mean, there is no use for the extra 10 decimals.
_________________________
!

download KiXnet

Top
#143918 - 2005-09-28 10:21 PM Re: Computer Inventory - Mailed to Admin
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Okay, well if I get around to it I'll add it to the list of changes for some future update
Top
#143919 - 2005-09-28 10:24 PM Re: Computer Inventory - Mailed to Admin
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
DOC's top 100 ToDo:

...
99. Root canal
100. Reduce decimal places
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#143920 - 2005-09-28 10:30 PM Re: Computer Inventory - Mailed to Admin
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
ROFLMAO

Les, you been hacking my calendar again.

Top
#143921 - 2005-10-05 03:46 AM Re: Computer Inventory - Mailed to Admin
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Okay, I got the root canal done

Updated the MyComputerInfo script.

; *********************************************
; ******** REVISION HISTORY ******************
; 2.01 *** 10/4/2005 6:02PM - By NTDOC
; ******** Modified to send to Admins as requested via e-mail using BLAT
; ******** DOWNLOAD BLAT: http://www.blat.net
; ******** Removed trailing decimal numbers from FREE SPACE.
; ******** Switched out GetIEVersion with GetIEVersion2 (previous udf was broken)
; ******** Added the $SO=SetOption('NoMacrosInStrings','On') option to the script
; ******** Renamed the script to: COMPINFO3.KIX

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.058 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org