If you can get hold of Dos 3.1 (If I remember it right) that may work and do what you are looking for. It would not be nice to re-invent the wheel.
overlordlink like this