Ketoconazole. Shampoos containing ketoconazole are most often used to treat dandruff, another condition that can cause skin flaking on the scalp. It also ...