how could i execute windows commands in the cmd window in 1 line for e.g

cd <some dir> , javac somefile.java , cd <another dir>, javac another.java