In short, yes. Opening or closing a window doesn’t matter—an air purifier is going to purify the air regardless. That said, keeping the doors and windows closed will help your air purifier to maximize its effectiveness since external pollutants aren’t able to come in.