In this paper, we report an adaptation of the Harbola-Sahni (HS) exchange potential to the tight-binding linear muffin-tin orbital (TB-LMTO) method to determine band gaps (BGs) of solids accurately. We show that the electrostatic basis of derivation of the Harbola-Sahni potential allows this nonvariational approach to improve substantially over local-density approximation derived BGs, bringing them very close to experimental values. That the accuracy of the HS potential is directly responsible for the determination of correct BGs is demonstrated by performing similar calculations with an accurate model potential that too leads to BGs close to their experimental values. Moreover, ground-state properties like equilibrium lattice parameters and bulk moduli (BM) for various semiconductors like C, Si, AlN, AlP, BP, and 3C-SiC calculated with the HS approach are in close agreement with the experiments. The clear physical interpretation of HS potential leads us to suggest exploring its use for calculating various properties of solids.