I've written a script to do just this, called switchpy.bat. It's described here: http://apipes.blogspot.com/2010/10/switchpy.html Or you can just grab the latest version at: https://bitbucket.org/tlesher/mpath/src/3edcff0e8197/switchpy.bat