Search code examples
windowsusbautoruninf

How to autorun a .exe file from a usb without using autorun.inf?


I am designing a security utility for USB sticks that when a memory stick has been plugged in,an email is sent to the user with the computer's name and IP address. I have got the email part working, but do not know how to execute the .exe file I have made when the USB is plugged in. I know autorun.inf hasn't worked for a while now, and I would like it to run automatically regardless of the PC it is plugged into. Any suggestions? Thanks.


Solution

  • I am pretty sure there is no way to store an executable onto a USB mass storage device in such a way that it runs automatically on all Windows PCs, because that would be a security risk.

    You can configure Windows to use AutoPlay though: go to Settings > Devices > Autoplay.

    If you have control over the firmware of the USB device, you might try emulating an HID keyboard and taking control of the user's computer that way. See BadUSB and USB Rubber Ducky.