Please post a small, complete program that compiles, executes and shows the error.

Do you get the error when you execute the program outside of the batch file?