You can use the ADSUTIL command to set the HttpRedirect property associated with a site, virtual directory or file.
For example to find out if a redirect is in place for the default.aspx of the web site with the id of 2:
cscript.exe adsutil.vbs get w3svc/2/Root/default.aspx/HttpRedirect
Now to set the redirect to "newlocation.aspx":
cscript.exe adsutil.vbs set w3svc/2/Root/default.aspx/HttpRedirect "http://mysite.com/newlocation.aspx, EXACT_DESTINATION"
And finally to remove the redirection you delete the property like so:
cscript.exe adsutil.vbs delete w3svc/2/Root/default.aspx/HttpRedirect
For more details on the HttpRedirect property, see MSDN
A word of caution: apparently the directory and file names are case-sensitive even though we're on a Windows OS. So make sure that you are using the right casing.