Germany's main weakness as a country is that it does not have the resources to support a grinding war of attrition. If you want a total victory, 1914 is certainly your best bet. In 1918, the best Germany can get is a negotiated peace where it can still maintain some national dignity, and that it's if the Entente somehow lack the capability to breach the Hindenburg Line.
Of course, I've always liked the idea that it could've won in 1916 at Verdun, where between June 8th and June 12th, the Germans were close to capturing Fort De-Souville, one of the last major forts at Verdun. The only thing that spoiled it was the Austrians utterly failing in their offensive at Tarantino and thus, requiring three German divisions to bail them out.
For context, during the crucial week where the German divisions were transferred, Robert Neville had only a brigade. The French used the breathing room given by the halting of the offensive to replenish their reserves. When the Germans did attack Fort De-Souville, it was a bloody draw.