Lock for a door, a window or the like, • having a bolt • having an inner bolt drive which has an inner bolt actuation member which is associated with an inner room side and an inner bolt gear mechanism between the inner bolt actuation member and the bolt and by means of which the bolt can be moved from a locking state into an unlocking state, • having an outer bolt drive which can be activated and deactivated and which has an outer bolt actuation member which is associated with an outer room side and an outer bolt gear mechanism between the outer bolt actuation member and the bolt and for which there is provided an actuatable switching device, by means of the actuation of which the activated outer bolt drive can be deactivated, wherein the bolt can be moved by means of the activated outer bolt drive from a locking state into an unlocking state and wherein the deactivated outer bolt drive is blocked by means of the switching device against a transfer of the bolt from a locking state into an unlocking state, and • having at least one bolt gear element which is common to the inner bolt gear mechanism and the outer bolt gear mechanism and which can be driven by means of the inner bolt actuation member or by means of the outer bolt actuation member with an unlocking movement in order to transfer the bolt from a locking state into an unlocking state, • wherein the bolt with the outer bolt drive deactivated can be transferred by means of the inner bolt actuation member from a locking state into an unlocking state by the outer bolt drive between the common bolt gear element and the outer bolt actuation member being deactivated in a state decoupled from the common bolt gear element, and by the common bolt gear element with the outer bolt drive being deactivated being able to be driven by means of the inner bolt actuation member with an unlocking movement, characterised in that the switching device for the outer bolt drive can be actuated by means of key actuation in a sense which deactivates the outer bolt drive. • having a bolt • having an inner bolt drive which has an inner bolt actuation member which is associated with an inner room side and an inner bolt gear mechanism between the inner bolt actuation member and the bolt and by means of which the bolt can be moved from a locking state into an unlocking state, • having an outer bolt drive which can be activated and deactivated and which has an outer bolt actuation member which is associated with an outer room side and an outer bolt gear mechanism between the outer bolt actuation member and the bolt and for which there is provided an actuatable switching device, by means of the actuation of which the activated outer bolt drive can be deactivated, wherein the bolt can be moved by means of the activated outer bolt drive from a locking state into an unlocking state and wherein the deactivated outer bolt drive is blocked by means of the switching device against a transfer of the bolt from a locking state into an unlocking state, and • having at least one bolt gear element which is common to the inner bolt gear mechanism and the outer bolt gear mechanism and which can be driven by means of the inner bolt actuation member or by means of the outer bolt actuation member with an unlocking movement in order to transfer the bolt from a locking state into an unlocking state, • wherein the bolt with the outer bolt drive deactivated can be transferred by means of the inner bolt actuation member from a locking state into an unlocking state by the outer bolt drive between the common bolt gear element and the outer bolt actuation member being deactivated in a state decoupled from the common bolt gear element, and by the common bolt gear element with the outer bolt drive being deactivated being able to be driven by means of the inner bolt actuation member with an unlocking movement,