This guide will walk you through the process of disabling the AutoPlay feature in Windows 7.
1. Click the Start and inputgpedot.msc” in the search box, then click the result to open the gpedit.

2. Expand Administrative Templates > Windows Components > AutoPlay Policies in order.  Then double clickTurn off Autpplay”.

3. Click Enabled, and then select All drive so that you can disable Autorun on all drives.  Click OK.

4. After restarting your computer, you have done all the needed work to disable AutoPlay in Windows 7.
Verification Source: Recipester.