No, France never had a chance to win the war.
From a strategic point of view, the Peninsular War had two levels: one international, French - British, whose initiatives would be sporadic. Other national, French - Spanish distinguished by a constant pressure that requires constant responses. A devilish sequence Action - Repression - Action.
The Peninsular War is a very complex war. It lasted six years. The strategic initiative was usually in the imperial army. Spaniards fought, usually, two ways:
a) The Guerrilla Warfare: acting on the enemy's rear, attacking their supply lines, communications, their mobile columns, isolated garrisons and checkpoints.
b) The Siege Warfare: usually performed by the regular army. Siege warfare was new for the Frenchmen, accustomed to war movement, which they had no rival. In Spain, the agile strategic maneuvers not working.. you are fighting against 12 million Spaniards.. so the winners of Rivoli, Arcole, Marengo, Austerlitz, Jena, Wagram, Dresde, Bautzen, Lutzen failed in Spain... "Pour soumettre un pays oú les habitants prenaient une parte si active a la lutte, il ne suffisait pas de le parcourir en touts sens avec des armées victorieuses, il fallait s´emparer de tous les points fortifiés; ocupier d´une manière permanente les principales positions; mettre en sûreté les depôts d´armes et des munitions, les magasins, les hôspitaux; assurer les communications et maintenir les populations toujours prêtes à se soulever..."
In this war, the sieges were almost as frequent as battles: Saragossa, Gerona, Astorga, Burgos, Badajoz, Ciudad Rodrigo, Lerida, Tarragona, Salamanca etc etc etc. An army of quality, is in the maneuver on the battlefield its main virtue... and that adventage is lost in urban combat: in Saragossa or in Stalingrad, in Gerona or in Hue, in Lerida or in Mogadishu...
(French lost more soldiers in Saragossa 1808 than in Germany 1806). The Lannes letter is very descriptive: street by street, house by house, room by room...not in those stupid fights where you must lose your excellent soldiers ...
And in the field.. the Guerrillas: Mina the young, Ezpoz y Mina, Llauder, Mansó, Eroles, Lacy, Milans del Bosch, Porlier, Longa, Empecinado, El Médico, el Pastor, el Barbudo etc etc etc.
French armies had defeated in a short time all the armies in Europe but they found in Spain the mountain actual everywhere and a very poor country, lacking resources... The Spanish Hell as it was said by the french soldiers... Napoleon is going to fail in Leipzig in 1813 because he still has 220.000 men in Spain.. in a war (1813) is virtually lost.
No, France lack of chance to win the War...