You may not want to do that as your device may be designed to operate on short impulse to turn on or off so constant voltage may damage it or make it go crazy. Something like a TV remote for example - it works fine if you press and release it, but jam the button down and you have unpredictable behavior.
DO THE FOLLOWING AT YOUR OWN RISK AS IT MAY RESULT IN SHOCK, FIRE AND OTHER DEATH RELATED INJURIES
You have been warned.
If you are still willing to try, you can use multimeter to find which pins to shot. Basically unplug the device, set the multimeter to measure resistance and look for pins that have infinite resistance between them when button is released and zero when it's pressed and short them. This will most likely damage your device, if not right away, in a very short time.