Close both sliding doors.
Measure the length between the front sliding door and the opposite frame of the closet, using measuring tape.
Cut a wood pole 2 inches longer than the measured distance, using a wood saw or a circular saw.
Measure the length of the rear sliding door and its opposite frame, using the same process.
Wedge the poles on top of the floor track, between the doors. The poles are slightly longer, so there will be a slight gap between the pole and track on one side. Your baby will not be able to open the door.
Open the front sliding door.
Place a window lever lock next to the rear sliding door on the track, toward the closet. Note that if the lever is facing out, it will end up inside the track, where it will not have enough room to move. Turn the lever one way to prevent the door from sliding, and the opposite way to allow the door to move.
Close the front sliding door. Place another lever lock to the side of it on the track, but make sure the lever is facing out. Your baby will not be able to open the sliding doors.