The problem of optimally controlling a Wiener process until it leaves an interval (a; b) for the first time is considered in the case when the infinitesimal parameters of the process are random. When a = ��1, the exact optimal control is derived by solving the appropriate system of differential equations, whereas a very precise approximate solution in the form of a polynomial is obtained in the two-barrier case.