Reading the Name of the Display Adapter


In Windows 9x, you can access system information more easily in the system.ini file than in the Registry. An .ini file has sections, each of which consists of a sequence of entries. Each entry has a name that is unique to the section (however, the same entry name might appear in different sections) and a value that follows an equals sign (=). Square brackets (\[ \]) surround the section names. For example, a section with two entries looks like

entryname1 = value
entryname2 = value

You can use VBScript code to access system information in the system.ini file. For example, suppose you want to read the names of the video display adapter (i.e., video card) on various workstations. As Listing A shows, you can write a script that scans the system.ini line by line to locate the display.drv entry within the \[boot.description\] section.

The script in Listing A uses the FileSystemObject object to open and work with the system.ini file. Because this file can have multiple entries with the same name, the script in Listing A uses the While...Wend statement with an embedded If...Then...Else statement to search for the display.drv entry under \[boot.description\].

After the script finds the display.drv entry, it passes the line to a user-defined function that unpacks the string and extracts the name of the video display adapter.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.