Question: May one remove a door from its hinges or a window from its frame on Shabbat?
Answer: In the previous Halacha we have explained that one of the works forbidden on Shabbat is building. However, just as it is forbidden to build something or add anything to a standing edifice on Shabbat, it is likewise forbidden to demolish something already built. This is called the forbidden work of demolishing on Shabbat.
Regarding our question, on one hand, the doors and windows of the house are affixed to the walls of the house but on the other hand, they are built separately and then mounted onto hinges or in frames. We must therefore discuss whether or not mounting or removing a door on Shabbat constitutes the prohibition of building or demolishing on Shabbat.
The Rambam (Chapter 10 of Hilchot Shabbat) writes as follows: “If one reinstalls the door of a ditch, pit, or balcony, this is a subcategory of building.” This means that if a door was taken apart before Shabbat and then one comes and reinstalls it on Shabbat, he has transgressed the prohibition of building on Shabbat. Similarly, disassembling a door on Shabbat constitutes the prohibition of demolishing.
Maran Ha’Shulchan Aruch (Chapter 308) rules likewise and explains that the reason for this is because the doors are attached to an edifice which is attached to the ground, the prohibitions of building and demolishing indeed apply.
Rabbeinu Nissim (Shabbat, page 47 of the Rif) rules that disassembling and remounting a door on Shabbat constitutes an actual prohibition of building and demolishing on Shabbat.
Based on this, the Turei Zahav writes that those who remove doors or windows on Shabbat transgress a Torah prohibition and they are obligated to bring a Chatat offering. Hagaon Rabbeinu Chaim Palagi rules likewise in his Sefer Kaf Ha’Chaim.
On the other hand, Hagaon Chazon Ish (Chapter 50, Section 10) writes that regarding our doors and windows which are installed loosely and swing on hinges such that they are easily removed, the Torah prohibitions of building and demolishing do not apply; there is only a rabbinic prohibition to do so. Other great Poskim concur regarding the letter of the law of doors and windows (even with regards to doors in those days) that this does not constitute an actual Torah prohibition. Regardless, halachically speaking, it is absolutely forbidden to disassemble or reinstall doors or windows on Shabbat (see Chazon Ovadia-Shabbat, Volume 5, page 283).
Summary: It is forbidden to disassemble or reinstall doors or windows on Shabbat.