I don't know of a standard way of doing that. These seems more like a script kind of thing. Why do you want to do this ?