We synthesized dimesogenic liquid crystals with both cholesterol and azobenzene groups by esterification of 10,12-docosadiynedioic acid or docosanedioic acid with 4-alkyl-4′hydroxyazobenzene (or 4-hydroxyazobenzene) and cholesterol and studied the thermal, optical, and glass-forming properties. Especially, we focused on the effect of the length of the alkyl chain substituted on the azobenzene unit and the photochemical isomerization of the azobenzene unit on the properties of the mesophases of the compounds or a host cholesteric liquid crystal forming stable glass when using them as a dopant. Two compounds without an alkyl chain on the azobenzene unit show a cholesteric phase, while five compounds with an alkyl chain from butyl to hexadecyl show only a smectic phase. The cholesteric reflection bands of the compounds without an alkyl chain on the azobenzene unit shifted toward shorter wavelengths upon photoisomerization of the azobenzene unit from the trans to cis form. Further photoirradiation induced an isotropic phase in the compounds. The compounds with an alkyl chain showing a smectic phase directly changed to an isotropic phase after the photochemical formation of a certain amount of the cis form. All compounds attained a glassy state by maintaining a molecular order if the compounds between the substrates were rapidly cooled from their liquid-crystalline temperature to 0 °C. When the compounds were doped with 2-10 wt % of a dicholesteryl ester forming a stable cholesteric glass, the cholesteric band of the mixtures shifted toward shorter wavelengths following the photoisomerization from trans to cis of the azobenzene unit on the dopant. The extent of the shift depends on the irradiation energy, temperature, and length of the alkyl chain on the azobenzene unit. The mixture went into the glassy state, keeping the shifted cholesteric reflection band after rapid cooling from the liquid-crystalline temperature to 0 °C. The cholesteric glassy state was stable up to 80 °C. Since the molecular arrangement of the liquid-crystalline compounds and the conformation of the azobenzene unit completely returned to the initial state upon reheating to its isotropic temperature, the photoresponsibility and glass-forming property of the compounds or mixtures are applicable to rewritable recording materials.