To produce a dvi file:
latex yourfile.tex
bibtex yourfile.tex
latex yourfile.tex
latex yourfile.tex
bibtex yourfile.tex
latex yourfile.tex
latex yourfile.tex
To produce a pdf file:
pdflatex yourfile.tex
bibtex yourfile.tex
pdflatex yourfile.tex
pdflatex yourfile.tex
bibtex yourfile.tex
pdflatex yourfile.tex
pdflatex yourfile.tex
However, for the windows user, with Miktex, there is an alternative that could simplify all those tasks - the texify.
To produce a dvi file"
texify yourfile.tex
To produce a dvi file and clean all the auxilary files:
texify -c yourfile.tex
To produce a pdf file (to clean all the auxilary files, just add -c as above):
texify -p yourfile.tex
To produce a dvi file and run the default viewer (add -p for pdf)
texify yourfile.tex --run-viewer