I am getting the mvn command not recognized as an internal or external command.
mvn
I have setup the M2_HOME, JAVA_HOME and added %M2_HOME%/bin to the path
Try setting the path of maven first through command prompt.
setpath.bat Open the cmd from the base window of the batch file.
setpath.bat
cmd
The rest maven commands can be used once path is set through cmd.