Matthew Parker took four wickets as Scotland beat Kenya by six runs in their ICC World Cricket League Division One clash in Rotterdam - setting up a crunch match against Afghanistan on Friday.
Parker played a key role as Kenya fell just short of their target, after Fraser Watts had scored a half-century in Scotland's total of 172 for eight in 50 overs.
Scotland will take on Afghanistan in two days' time, knowing they will advance to a final against Ireland with victory. Afghanistan would also reach the final should they win.
The Scots won the toss against Kenya and chose to bat, with Preston Mommsen and Ollie Hairs immediately putting on 41 for the loss of the first wicket.
Hairs was dismissed by James Ngoche for 27, Mommsen was then run out for 11, and with the loss of Richie Berrington (two) and Neil McCallum (six) Scotland were wobbling on 74 for four - with Ngoche having taken three of the wickets.
However, a stand of 73 between Watts and Moneeb Iqbal offered the Scots some stability with the former reaching 50 off 90 deliveries before he became the first of Tim Odoyo's three victims.
Iqbal was next to go for 36 before Gordon Drummond (three) and Dougie Lockhart (14) were also removed as Matthew Parker and Gordon Goudie saw Scotland over the line to 172 for eight.
Ngoche finished with bowling figures of three for 18 and Odoyo three for 43.
Kenya made an awful start to their response, Maurice Ouma falling with just one on the board as he became Parker's first victim.
Collins Obuya fell for one before Alex Obanda made what would turn out to be Kenya's top score of 39. When Rakep Patel went for three the Kenyans were 52 for four and struggling.
A stand of 42 between Odoyo (17) and Jimmy Kamande moved the score on to 94 but the Kenyans then lost four wickets for nine runs, including Kamande for 34, to find themselves at 115 for nine.
Some heroic rearguard resistance by Ngoche and Nelson Odhiambo guided Kenya to 166 in a stand of 51, but when the latter was out for 29 the game was over with eight deliveries, leaving Ngoche unbeaten on 21.
Parker finished with four for 33 from nine overs, with Dominic Wesonga, Ngoche and Odhiambo joining Ouma as his victims.