Here are the steps on how to disable Autorun in Windows 7:
Step 1. Press Windows key + R to launch the Run dialogue box. Here you need to enter Gpedit.msc and then click on OK.
Step 2. You will now see the Local Group Policy Editor on your screen.
Step 3. On the Local Group Policy Editor, you need to click on Computer Configuration > Administrative Templates> Windows Components. Under Windows Components, you will see AutoPlay Policies.
Step 4. When you click on AutoPlay Policies on the left, you will also see an option that says Turn off AutoPlay on the right. Click on it and then choose the Edit option.
Step 5. On the Turn off AutoPlay window, you need to select the Enabled option
Step 6. Click on the Apply and OK buttons and to finish the disable Autorun feature on Windows 7. Also make sure you select the All drives option as shown on the screenshot of step no.5 in order to disable the Autorun feature on all drives.