Did you run the file from Melabs before you set the environment variable?

And why are you compiling in MCS and then moving it to MPLAB?