If they sold it to you as new and then you discover it has pirated Windows, you have the right to file a complaint. First thing is to go directly to the store with your proof of purchase and demand a solution (exchange, refund, or upgrade to a legal license), because basically they sold you a defective product. If the store won't cooperate, you can file a complaint with the consumer association in your autonomous community or contact the General Consumer Affairs Department, they're the ones who handle these matters. You could also consult with a lawyer if the computer cost you quite a bit of money, though normally these organizations resolve things without needing to go that far.