Can a USB diagnostic device launch an uninstalled app through AutoPlay?

Arixx 20 Reputation points
2026-09-08T17:57:53.2433333+00:00

I'm developing AEGIS, a legitimate USB-based PC diagnostic/repair tool. I want a technician to plug the USB into an arbitrary Windows 10/11 PC and receive a visible, user-consented prompt that launches the AEGIS application stored on the USB. The application is not preinstalled on the PC.

I am NOT looking for silent execution or a security bypass. I want to know whether Windows provides an officially supported USB device, AutoPlay, device-metadata, or similar mechanism for this workflow. If not, what is the closest supported architecture?

Windows development | Windows API - Win32

Answer accepted by question author
Taki Ly (WICLOUD CORPORATION) 4,440 Reputation points Microsoft External Staff Moderator
2026-09-09T03:51:11.1766667+00:00

Hello @Arixx ,

Thanks for the clear, security-conscious framing.

The following is what the documentation actually supports, and why it doesn't fit the "uninstalled app on the USB" requirement:

1. AutoPlay (content / device events) AutoPlay can present your app as a user-consented option when a volume or device is connected, but only for a pre-defined event (for example StorageOnArrival, ShowPicturesOnArrival, WPD\ImageSource) or a CustomEvent you declare in an autorun.inf. Crucially, autorun.inf here only names an event. An installed UWP app that declares AutoPlay Content or AutoPlay Device in its package manifest is what actually handles it. autorun.inf does not launch an .exe from the drive.

2. UWP device apps + device metadata You can associate an app with your device via device metadata so it shows up as the AutoPlay handler, but the docs state plainly that "your app can't install automatically without device metadata," and even with metadata the association is to a Store/UWP app, not an arbitrary executable running from the USB. Also note this technology is on the way out:

Device metadata is deprecated and will be removed in a future release of Windows.

3. Windows App SDK There is currently no documented or planned equivalent of "UWP device apps" in the Windows App SDK, so that isn't a forward-looking path either.

Closest officially supported architectures

  • Installed app + AutoPlay registration. Install AEGIS on the PC, register it as an AutoPlay handler via the app manifest, and handle activation when the device is connected. This is the fully supported model, but it conflicts with your "not preinstalled" requirement.
  • UWP device app + device metadata. Associate the device with a UWP app and declare AutoPlay Device, handling OnActivated and reading DeviceInformation.Id. This works, but relies on the deprecated device-metadata path.
  • General AutoPlay option without device metadata. AutoPlay can still offer an already-registered app as an option, but it will not auto-install anything.

Since your goal is a portable diagnostic/repair tool that runs on machines where nothing is pre-installed, the realistic supported options are:

  • Manual launch from the drive. The technician opens the USB in File Explorer and runs the executable. This is the standard, expected model for portable tools. There is no auto-launch, but it is fully supported and requires no installation.
  • Bootable USB (WinPE / Windows PE). For a true "plug in and run without touching the installed OS" repair workflow, boot the machine from the USB into a WinPE environment. This is the officially supported architecture for diagnostic and recovery tooling that must run independently of the installed Windows image.

So, to directly answer your follow-up: there is no supported Win32/USB mechanism that auto-launches (even with consent) an uninstalled app residing only on removable media. If you want automatic prompting, an app has to be installed or registered on the PC first. If you want a no-install experience, manual launch or a bootable WinPE image are the supported routes.

Hope this helps clarify the options. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

Thank you.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-09-08T17:58:11.41+00:00

    No supported Windows mechanism in the provided material allows a USB device to launch an app that is only stored on the USB and not installed on the PC.

    What AutoPlay does support:

    1. AutoPlay can present an app as an option when a user connects a device.
    2. For UWP device apps, AutoPlay activation is tied to an app package and its manifest declarations.
    3. Device manufacturers can associate a UWP device app as an AutoPlay handler through device metadata.
    4. Without device metadata, AutoPlay can still offer an app as an option for connected devices, but the app cannot install automatically.

    What this means for the described workflow:

    • The documented AutoPlay model is based on a registered app on the PC, not an arbitrary executable launched directly from removable media.
    • For UWP device apps, the app must declare AutoPlay Device or AutoPlay Content in the package manifest.
    • If using device metadata, the app association is with a Microsoft Store/UWP device app.
    • The material does not describe any supported AutoPlay or device-metadata path that launches an uninstalled Win32 app from the USB itself.

    Closest supported architectures in the provided material:

    1. Installed app + AutoPlay registration
      • Install the app on the PC first.
      • Register it through the app manifest as an AutoPlay handler.
      • Handle activation in the app when the device is connected.
    2. UWP device app associated with the device
      • Use device metadata to associate the device with a UWP device app.
      • Add the AutoPlay Device declaration in the app manifest.
      • Handle activation in OnActivated and read the DeviceInformation.Id from the activation arguments.
    3. General AutoPlay option without device metadata
      • AutoPlay can offer the app as an option for supported device/content scenarios.
      • This still does not provide automatic installation of the app.

    Also relevant for planning:

    • Device metadata is deprecated and will be removed in a future Windows release.
    • The provided Q&A states there is currently no documented equivalent of UWP device apps in Windows App SDK.

    So, for a technician workflow on arbitrary Windows 10/11 PCs, the closest officially supported design in the provided material is: have an app installed on the PC and registered as an AutoPlay handler. The provided material does not document a supported way for a USB diagnostic device to trigger a consented launch of an uninstalled app residing only on the USB.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.