Denvir was taken to occupied Yugoslavia where he was held in a prisoner of war camp at Maribor. In September 1941, he managed to escape with two others and made his way to Zagreb, where he was recaptured a week later. As punishment, he received three weeks of solitary confinement. This did not deter him from further escape attempts, and in December he again was able to get away from his captors. This time, he made his way to Ljubljana, in Slovenia. Initially intending to make their way to Turkey, a neutral power, he and another escapee decided to link up with Yugoslav partisans (National Liberation Army and Partisan Detachments of Yugoslavia) the following month instead.