Fixed.
I had the XP SP3 compatibility mode for sed.exe enabled, just disabled it and everything runs fine now.