Previous Topic: MIF and Inv File FunctionsNext Topic: CreateMIFGroup - Create a Group


CreateMIFFile - Create an MIF File

Valid on UNIX and Windows

CreateMIFFile function creates an MIF file.

Function format:

CreateMIFFile(Filename as string, Name as string, Description as string) as integer
Filename

Specifies the file name for the MIF file.

Name

Specifies the Component Name to store in the MIF file.

Description

Specifies the Description to store in the MIF file.

The return value of the function is an integer.

Example:

This example stores the Current Directory on C: into a MIF file, together with the free disk space. This is stored in the Workstation Directory. The example works only if asset management is installed.

Dim Dir as String
Dim DriveFree as Integer

'Get directory
Dir = GetDirectory(3)
DriveFree = GetDiskFreeMB(3)

'Create .MIF file
CreateMIFFile(ComputerPath+"Disk.MIF","My Disk Inventory ","","")
CreateMIFGroup(ComputerPath+"Disk.MIF","Disk Info","Disk information","AMClass")
CreateMIFString(ComputerPath+"Disk.MIF","Disk Info","Current Dir",Dir,"Dir name")
CreateMIFInteger(ComputerPath+"Disk.MIF","Disk Info","Free in MB",DriveFree,"Free MB")