Reset the check engine light on 1997 Ford Ranger

How do you reset the check engine light? I have changed the pvc / egr valves / gas cap / & 3 oxygen sensors; but the light is still on. Need smog check; will it pass with the light on?

Asked by for the 1997 Ford Ranger
To reset the Check Engine Light, you can try disconnecting the Battery negative cable for 2 minutes, if you do not have a scan tool. If the light comes back on, then you need further diagnosis. Why did you replace all the parts? What were the codes. If you just try parts to fix a code, it could take forever because there are hundreds of codes just for a Check Engine Light. I would have someone scan the computer if the light comes back on. Also, you need to drive the truck for a couple of days to reset the computer after the codes are cleared. It is called a 'drive cycle'. It is pretty complicated, so I advise just cold starting the truck and doing some city and highway driving. Your truck will NOT pass smog with the Check Engine Light on or if the computer has not had its monitors properly reset after a code is cleared ( drive cycle ). I do Smog in CA and this part is universal in all States.
Thanks for the response; our forklift mechanic at work (a former certified Honda Mechanic) told me that it had to be one of these things; he has helped me a great deal in the past; so took his advise; did them one at a time so see if there was any results. As you can see still nothing; however, being a Honda mechanic he wasn't sure on how to reset the light on a Ford. Also i was told by someone else to disconnect the POSITIVE side of the battery; you say the NEG SIDE; i will try that and then drive it a couple of days; hopefully it will go out. Again thanks a lot for the advice.