Kelvin probe force microscopy (KPFM) is one of the most promising non-contact electrical nanometrology techniques to characterize doped semiconductors. By applying a recently introduced explanation of measured KPFM signals, we show the applicability of KPFM to determine and control surface-near electrostatic forces in planar doped silicon and in doped silicon nanostructures. Surface-near electrostatic forces may be used for the immobilization of nano- and biomaterials in future sensor applications in nano- and biotechnology. Additionally, the influence of the electrostatic potential distribution in doped semiconductor nanostructures, e.g. in horizontal Si nanowires, and its influence on the surface-near electrostatic forces are discussed. It is explained how drift and diffusion of injected electrons and holes in intrinsic electric fields influence the detected KPFM signal. For example KPFM is successfully employed to locate p+p and n+p junctions along B-doped and As-doped p-Si nanowires, respectively. As an outlook the physical immobilization and the transport of biomaterials above arrays of separately addressable doped semiconductor cells will be discussed.