The road from Kabul to Bamiyan is about 230 km but takes between 6 and 10 hours depending on the route and the security situation. There are two roads:
The southern route via Wardak and Maidan Shahr is shorter, paved for most of the way, but historically more dangerous because of Taliban presence south of Kabul.
The northern route via Parwan, the Salang/Shibar Pass, and Doshi is longer (about 8–10 hours), unpaved in places, but historically safer and considered more scenic — through dramatic Hindu Kush passes.
A small Bamyan Airport (BIN) operates flights to and from Kabul — when conditions permit, this is the easier option. Operated under various names over the years; check schedules close to your travel date.
Drive yourself only with local knowledge. A driver-and-vehicle hire through a reputable Kabul agency is the standard arrangement for foreign visitors; it includes security risk assessment and route planning. Conditions and routes change quickly; check the situation in the days before you travel.