There are several reasons for this problem. AutoPlay might be restricted by Group Policy, it could be canceled by a program that is running, or the service that AutoPlay needs to start might not be running. Check if AutoPlay is restricted by Group Policy. Close other programs that might be interfering by accessing the device or media directly. Run the command prompt as Admin then type net start shellhwdetection, and then press Enter.
Restart your computer.