Fixes #5588: correct handling of inventory on windows