i liked this so it was just one line.

 if os.type() == "win32" and filepath ~= nil then