Couldn't you just do this with an ordinary batch file?