A UPS will not fix a faulty PSU. It will only provide that little extra bit if there are very small power drops, provided the UPS is charged. A UPS will not power a computer without a working PSU.
You never said. What are you doing at the time it shuts down?
