Could you tell me how to write a program to open and reject Cd ?