Measure the length for the first side of railing. Transfer this measurement to a 1-by-2 inch board and cut it off with a saw. Sand down the rough edge with fine-grit sandpaper.
Drill holes every 6 inches into one of the long, thin sides of the railing board. Use a drill bit that is exactly the same diameter as the finishing nails you will be using to attach the railing. Make the holes 1 inch in depth.
Set 2-inch framing nails inside the holes with their pointed ends sticking out. Position the board in its desired location and push the board down toward the desk so that the nails make marks in the surface. Remove the board and pull each nail out of the railing with a pair of pliers. Set the nails in the markings they made and hammer them into place, with about 1 inch sticking out of the top of the desk.
Apply a light and even coat of stain or paint to the wood railings. Brush in the same direction as the wood grain. Let the first coat dry for two hours then reapply a second coat. Add more coats, if necessary, until the dried finish matches the rest of the desk or has the desired appearance.
Add a coat of sealant to the dried stain or paint with a brush and paint in the same direction as the previous coats. Let the sealant dry for two hours then apply a second coat. Wait for it to dry overnight.
Wrap some fabric around a hammer head and secure it with a rubber band. Slide the finished railing over the finishing nails and tap it with the hammer lightly, if necessary, to secure it in place.
Add additional railing pieces around the desk. Attach the pieces together with two finishing nails hammered through the joints.