We present a method to control the motion of drops in a wide and thin microchannel, by etching fine patterns into the top surface. Such control is possible for drops that are squeezed by the channel roof, by allowing them to reduce their surface energy as they enter into a local depression. The resulting reduction in surface energy pulls a drop into the groove such that localized holes can be used to anchor drops, while linear patterns can be used as rails to guide them along complex trajectories. An anchored drop remains stationary as long as the velocity of the surrounding oil is below a critical value which depends namely on the drop size and channel geometry. A rail guides drops whose size is below a critical radius which can be used to separate drops based on size or on their physical properties.