Desk locks are normally a cam lock much like you would find on a cabinet drawer. Cam locks have a piece of angle steel that rotates with the key cylinder. If you need to replace the lock or the lock is not working properly, it is necessary to remove the desk lock. Manufacturers use a couple of different methods to secure the lock to the desk drawer. Most often they use either a slide clip or a single retaining nut.
Unlock the desk drawer with the key and leave the key in the lock. Open the desk drawer and remove the contents from the drawer. Examine the back of the lock to determine how the lock will come off the drawer.
Pry the C-clip on the neck of the lock sideways with a flathead screwdriver, if your desk lock uses a C-clip.
Rotate the key to the locked position. The cam should point up. Grasp the bottom of the key and pull the lock assembly out of the desk drawer while tilting it up to pull the cam through the hole. It might be necessary to unhook the side bar from the top of the cam while removing the lock from the drawer. The side bar simply hooks into the cam.
Turn the centre hex nut on the back of the desk lock with a wrench, if your lock uses the large centre nut. Un-thread the nut from the lock body threads and slide the nut and flat washer over the lock cam. Pull the lock of the desk drawer.
Find the screws securing the lock mounting plate to the back of the drawer if your lock does not use any of the above methods. Some manufacturers simply use two small screws to mount the backing plate to the drawer. Remove the screws with a Phillips-head screwdriver and pull the lock through the inside of the drawer.