Five tries by from Ryan Evans, Daniel Thomas, Jordan Williams, Jack Dando and Cory Allen and 20 points from the boot of Sam Davies ensured the win in the warm-up international, but they will be disappointed with their defence towards the end, conceding three late tries.
Gruff Rees' side play England at Auch on Sunday (5pm) having qualified for the Elite Group of the European tournament after beating Italy last month. They had earlier lost to France but the 26-12 win in Parabiago guaranteed them a place in the top four of the event, staged in the Armagnac-Bigorre region of France.
Wales went in 25-10 and three tries to one up at half-time thanks to quality scores from centre Evans, flanker Thomas and hooker Dando along with two conversions and two penalties from Ospreys outside half Davies.
Scotland managed ten points through a try, conversion and penalty from Sam Hidalgo-Clyne.
A low point of the half for Wales came when influential centre Thomas Pascoe was stretchered off. He was replaced by Jordan Williams of the Scarlets, who got on the scoreboard with the first try of the second half after a penalty from Sam Davies. Davies duly converted the try but it was all Scotland for most of the remaining game time, three tries coming for replacements Keith Buchan and Danny Kennedy along with centre Robbie Ferguson, and two conversions for Hildago-Clyne.
Wales full back Cory Allen raced over for a try on the right wing with five minutes to go and there will be much to review and build on ahead of the European semi-final against the old enemy on Sunday.
Head coach Rees said, "We are pleased, but we are also frustrated by the way the team tends to lack composure at times. We showed some real attacking intent with some quality tries, but the team then lost shape, started to concede points and ended up scrambling at the end.
"Having one two of our three international matches we are pleased with the progress we've made since the disappointing loss to France and we know what we need to work on ahead of the game against England on Sunday. We are looking forward to the challenge the tournament environment will bring to the players both on and off the field."
Wales scorers: Tries:R Evans, D Thomas, J Dando, J Williams, C Allen; Cons: S Davies (4); Pens: S Davies (4)
Scotland scorers: Tries: S Hildalgo-Clyne, K Buchan, R Ferguson, D Kennedy; Cons: Hildalgo-Clyne (3); Pen: Hidalgo-Clyne
Wales: Cory Allen (Blues); Owen Jenkins (Blues), Ryan E Evans (Blues), Thomas Pascoe (Blues), Jack Randall (Scarlets); Sam Davies (Ospreys), Rhodri Williams (Scarlets); Thomas Davies (Blues), Jack Dando (Blues), Bradley Thyer (Blues), Jack Jones (Ospreys), Rhodri Hughes (Ospreys), Ellis Jenkins (capt, Blues), Daniel Thomas (Scarlets), Ieuan Jones (Dragons).
Replacements (all used): Evan Yardley (Ospreys), Calum Lewis (Blues), Daniel Suter (Ospreys), Sion Bennett (Scarlets), Lewis Young (Blues), Alex Schwarz (RGC), Rhys Patchell (Blues), Jordan Williams (Scarlets)