Automatically run an installer when device is plugged in

Leigh 21 Reputation points
2021-12-20T21:43:57.793+00:00

There has been a topic troubling me for a while that I really want to find an answer to.

Companies like Razer, SteelSeries and other vendors are able to manufacture devices like keyboards and mice which will automatically run an application when plugged into a PC - this is usually just an application which prompts the user to install their software and lighting controllers. How is this achieved?

On my journey, I found that it used to be done with an Autorun.inf file; this was disabled after Windows 7 because of virus and malware issues taking advantage of it. The other way I found while scraping forums was a CD-ROM partition with this very same Autorun.inf kind of setup which Windows supposedly would allow an application to automatically start if it was on a CD-ROM partition. While heavily disputed, there were recommendations of U3 USB drives and other custom memory controller flashes which would create a CD-ROM partition with an application to autostart.

How is this actually achieved today?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,618 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,754 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,166 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sean Liming 4,511 Reputation points
    2022-01-01T18:44:24.88+00:00

    Correct: It is because of malware getting into a system, that Windows blocks the autorun.inf. Another example that I have used, is a USB hotspot device from a telephone carrier. These devices also perform an installation of drivers and software when the device is plugged in. These devices are composite (hybrid) devices that appears as multiple devices when plugged into a system. You can see this in device manager as the devices is plugged in. As you probably have noticed, one of the devices that appear is a CD ROM. The PnP ID are programmed into the USB controller of the device.

    Your question is: "how are they able to kick off the installer?" From past experience, it is when the CD-ROM portion of the composite device is loaded that Windows kicks off the installer, thus the autorun/autoplay feature. One guess is that autorun.inf is still enabled for CD-ROM devices.

    What you might be experiencing is that Windows Update searches for the driver and kicks off the installer. I have seen this happen with my HP printer. Windows will install HP software from Windows Update automatically when the printer is attached.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Limitless Technology 39,356 Reputation points
    2021-12-27T17:31:30.99+00:00

    You can experiment with doing this by managing device installation through a group policy.

    You can use the guide below and understand how to apply this management:

    https://learn.microsoft.com/en-us/windows/client-management/manage-device-installation-with-group-policy

    ----

    --If the answer is helpful, please vote positively and accept the answer--


  2. S.Sengupta 15,111 Reputation points MVP
    2022-01-01T06:51:24.107+00:00

    Kindly go through the following Microsoft article:
    Creating an AutoRun-Enabled Application