An agent loaded in a computer's operating system (OS) simulates
disconnection and reconnection of a device, with no need to actually
disconnect the device logically from a computer. During simulated
reconnection, when the OS requests the hardware ID of the device, the
agent returns a substitute ID, which causes the OS to load a substitute
driver. Substitution of the ID also allows driver substitution for a not
yet logically connected device; in this cases, no simulated disconnection
or reconnection is needed. Driver substitution is dynamic and reversible,
with no need to restart the system or reboot the OS and substitution of a
driver for one device of a type does not disturb other devices of the
same type. The invention may be implemented entirely in software, with no
need for hardware modifications or device customization.