I have written the run.bat file to compile as well as run my c++ code through the windows terminal. The file contains only two commands:
g++ %1.cpp -o %1.exe