scanner: make more portable to windows