Spinner Dan Vettori got two wickets smartly to complete his 300 in ODIs, the first New Zealander to the milestone. He was on a hat-trick a little later, the Afghanistan batsmen baffled by his flight and variations.
But Shenwari and, especially, Najibullah batted assertively.
Lefthander Najibullah lifted Tim Southee onto the roof of the Harris stand - and was dropped off a skier at deep square leg next ball by Martin Guptill - and played a string of aggressive shots.
When Southee delivered the first ball in the second power play, Najibullah swung him hard and far back on the grass bank.
His second ODI 50 came off 52 balls but unfortunately or Afghanistan that's where it ended, as he speared a catch to third man off Adam Milne.
Shenwari was more circumspect but played some handsome drives and lofted a six into the crowd at mid wicket off Corey Anderson on his way to his second fifty of the cup - and 10th overall - in 101 balls.
He also recovered from a solid blow on the back of his helmet from an Anderson bouncer, which left a distinct dent. He needed a few minutes treatment in the following over after dropping to his haunches.
Vettori's four for 18 were the pick of New Zealand's bowling figures. Trent Boult was among the wickets early and finished with three for 34 off his 10 overs while Anderson picked up two and Milne one.
For more coverage of the Cricket World Cup from nzherald.co.nz and NZME check out #CricketFever.