Try 4NT (http://www.jpsoft.com). It is like cmd on steroids. I've been using it for years and it is the *only* thing that makes powerful batch files possible on Windows. It has a slew of features, including batch file debugging.