Ketoconazole cream is usually applied once a day for 2 to 6 weeks. Prescription ketoconazole shampoo is usually applied one time to treat the infection. Over-the-counter ketoconazole shampoo is usually used every 3 to 4 days for up to 8 weeks, and then used as needed to control dandruff.