Quote:

jwmac

Just an FYI - using the CODE TAGS instead of QUOTE will preserve your formatting better.




thanks for the tip
Code:
 break on

$InvCheck = READVALUE ("HKEY_LOCAL_MACHINE\HARDWARE\IT Inventory", "Stamp")
If $InvCheck = 1
Goto End
Else
cls

? "Performing an inventory of this computer... please wait..."
? " Thank you!"
sleep 2

$WMI = "WINMGMTS:{IMPERSONATIONLEVEL=IMPERSONATE}!//@WKSTA"
$ComputerModel = GetObject($WMI).ExecQuery("Select * FROM Win32_ComputerSystem")
$FindBIOSInfo = GetObject($WMI).ExecQuery("Select * FROM Win32_BIOS")
$DiskSet = GetObject($WMI).ExecQuery("SELECT * FROM WIN32_LOGICALDISK WHERE DriveType=3")
$mem = memorysize(0)
$netinfoip = ENUMIPINFO (0, 0, 1)
$netinfonic = ENUMIPINFO (0, 2, 1)

For Each $model in $ComputerModel
$CompModel = $model.model
Next

For Each $tag in $FindBIOSInfo
$servicetag = $tag.SerialNumber
Next

$TotalSpace = 0.0
$FreeSpace = 0.0

For Each $Disk in $DiskSet
$DriveName = $Disk.Name
$FreeSpace = $FreeSpace + $Disk.FreeSpace
$TotalSpace = $TotalSpace + $Disk.Size
$Format = $Disk.FileSystem
Next


$TotalSpaceGigs = $totalspace / 1073741824
$FreeSpaceGigs = $FreeSpace / 1073741824

REDIRECTOUTPUT ("@LServer\inventory$\inventory.csv")


? @Date", "@Time", "@Site", "@LServer", "@WKsta", "$Servicetag", "@WUserID"
, "@Producttype", "@CSD", "@CPU", "@MHz", "$mem", "$DriveName",
"Round ($FreeSpaceGigs,1)", "Round ($TotalSpaceGigs,1)", "$Format",
"$netinfoip", "@Address", "$netinfonic

REDIRECTOUTPUT ("@LServer\inventory$\inventory.log")
? "**********Computer: "+@WKsta"**Site: "+@Site"*************"
? @Date
? @Time
? @Site
? @LServer ;logon server
? @WKsta
? $CompModel
? $Servicetag
? @WUserID ;username
? @Producttype" w/ "@CSD
? @CPU
? @MHz"MHz"
? $mem"MB"
? $DriveName
? Round ($FreeSpaceGigs,1)
? Round ($TotalSpaceGigs,1)
? $Format
? $netinfoip
? @Address
? $netinfonic
?
$WMI = 0

WRITEVALUE ("HKEY_LOCAL_MACHINE\HARDWARE\IT Inventory", "Stamp", "1", "REG_SZ")
WRITEVALUE ("HKEY_LOCAL_MACHINE\HARDWARE\IT Inventory", "Date", "@Date", "REG_SZ")

Redirectoutput ("")
cls
? "Inventory Complete!"
sleep 2
:end
exit



Edited by jwmac (2005-12-22 09:12 PM)