I am often like throwing all over board. But all the invested money would be gone.
Beware the sunk cost fallacy http://wiki.lesswrong.com/wiki/Sunk_cost_fallacy - sometimes throwing invested money away is the most sensible thing to do.
Flailing away at something that has no chance of success is just as harmful as not seeing a project through.
How do I make myself keep going?
Figure out would need to happen to keep you on the project. What are your bounds for success and failure. Figure out what your assumptions are. Figure out ways to validate them. Set targets for reviewing and assessing your assumptions and whether it's worth while continuing.
If I'm selling hammers to Peruvian Nose Flute Carvers what's my biggest risk? Maybe it's finding a channel to that market. So I might look at my costs and figure out that I need to bring in 10 new customers a week to turn a profit.
So before doing anything else I might see if I can get 20 Peruvian Nose Flute Carvers added to my address book over the next four weeks. Just to discover whether I have some sort of channel to the market.
If I can - yay I dig in some more. Maybe look to get 20 Peruvian Nose Flute Carvers interested in hammer purchases over a four week period.
If I can't maybe it's time to reassess my target market. Or my business.
Setting short term goals and targets help you evolve your business based on real feedback from customers. They also give you some positive feedback along the way to the "big" goals to keep you motivated.
If none of your intermediate goals ever succeed - then it's probably time to reassess whether the business model works in it's current state.