HOWTO: Disable Plug and Play for a Serial Hardware Device

ID: Q153385


The information in this article applies to:


SUMMARY

Certain existing hardware serial devices that have been in use in Windows 3.x and MS-DOS may not behave as desired when the Plug and Play enumeration activates the control lines.

This article provides a sample INF file that installs when the user activates the Hardware Wizard on "other device," selects "have disk," and picks the COM port from the list. It disables the Plug and Play by removing the enumerating reference from the registry. As an added bonus, this INF can also create a subdirectory and copy in software as shown. This can be expanded to multiple files and disks. Note that during power up, this glitching of the serial control lines can still occur and a redesign of the hardware may still be necessary in the long run.


MORE INFORMATION


   ;------------------- START INF SAMPLE ------------------------------
   ;Sample INF for a device that needs to disable Plug and Play enumeration
   ;on a com port & copy an application for the device into new
   ;subdirectory. "SAMPLES, INC." is meant to be a fictitious company name.
   ;The "application" is just a text file SAMPAPPL.TXT to show the copying.
   ;Always save your registry files SYSTEM.DAT and USER.DAT before testing
   ;any INF file.

   [Version]
   Signature=$Chicago$
   Class=OldComDev
   Provider=%StrPro1%

   [DestinationDirs]
   Hrdwr1234.CopyFiles=30,SAMPAPPL

   [Manufacturer]  ;will not show up since there is only one here
   %strman1%=SAMPLE

   [SAMPLE]        ;list of ports for device to be manually selected by
                   ;user
   %StrConfig1%=Hrdwr1.inst,Hrdwr1
   %StrConfig2%=Hrdwr2.inst,Hrdwr2
   %StrConfig3%=Hrdwr3.inst,Hrdwr3
   %StrConfig4%=Hrdwr4.inst,Hrdwr4

   [Hrdwr1.inst]   ;INSTALL section COM1
   DelReg=Hrdwr1.DelReg
   CopyFiles=Hrdwr1234.CopyFiles

   [Hrdwr1.DelReg]
   HKLM,"System\CurrentControlSet\Services\Class\Ports\0000",Enumerator

   [Hrdwr2.inst]   ;INSTALL section COM2
   DelReg=Hrdwr2.DelReg
   CopyFiles=Hrdwr1234.CopyFiles

   [Hrdwr2.DelReg]
   HKLM,"System\CurrentControlSet\Services\Class\Ports\0001",Enumerator

   [Hrdwr3.inst]   ;INSTALL section COM3
   DelReg=Hrdwr3.DelReg
   CopyFiles=Hrdwr1234.CopyFiles

   [Hrdwr3.DelReg]
   HKLM,"System\CurrentControlSet\Services\Class\Ports\0002",Enumerator

   [Hrdwr4.inst]   ;INSTALL section COM4
   DelReg=Hrdwr4.DelReg
   CopyFiles=Hrdwr1234.CopyFiles

   [Hrdwr4.DelReg]
   HKLM,"System\CurrentControlSet\Services\Class\Ports\0003",Enumerator

   [Hrdwr1234.CopyFiles]
   sampappl.txt

   [SourceDisksFiles] ;list disks for files
   sampappl.txt=1

   [SourceDisksNames] ;define disks - only one setup disk
   1="Disk Number ONE",,

   [Strings]
   StrPro1="Samples, Inc."
   StrMan1="Samples, Inc."
   StrConfig1="device plugged into COM1"
   StrConfig2="device plugged into COM2"
   StrConfig3="device plugged into COM3"
   StrConfig4="device plugged into COM4"
   ;------------------- END INF SAMPLE ------------------------------ 


Keywords          : kbcode DdkComm 
Version           : 4.0
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: March 4, 1999