Windows konvertiert "%~dp0" zum aktuellen Pfad, also z.B.: "C:\foo\bar\"
In sys.argv kommt aber das an: 'C:\\foo\\bar"'
Gut, ein work-a-round mit .strip() tut's erstmal... Aber ist doch doof... oder gar ein Bug?!?
EDIT: Ach, ein work-a-round von außerhalb ist "%~dp0." in der batch zu nehmen. Das wird zu "C:\foo\bar\." und das in Python zu "C:\\foo\\bar\\." und per os.path.normpath() ist hinten dann alles weg: "C:\\foo\\bar"
Erinnere mich gerade daran, das robocopy (Ein tool von Microsoft selbst) das selbe Problem hat. Hab dazu bei http://ss64.com/nt/robocopy.html was gefunden:
If either the source or desination are a "quoted long foldername" do not include a trailing backslash as this will be treated as an escape character, i.e. "C:\some path\" will fail but "C:\some path\\" or "C:\some path\." or "C:\some path" will work.