[Tex/LaTex] Using the command window to convert LaTeX to HTML

conversionmiktextex4htwindows

I am trying to convert a LaTeX file to HTML. I have tried to do this by typing cmd into the search bar of the START menu. When the black background box comes up, I type in htlatex filename.tex where instead of filename I write the name of the file. It then comes up,

I can't find file filename.
Please type another input file name.

I am using MiKTeX and Windows 7.

Best Answer

You need to change to the folder containing filename.tex before executing htlatex filename.tex. Under Windows, this can be achieved using

cd path\to\the\folder

You can either use backslashes \ or forward slashes /. If your path contains spaces, you can either use TAB to let Windows auto-complete a partially completed folder name (that is, you type cd Docu and press TAB and Windows will auto-complete this to cd "Documents and Settings"), or use quotes to denote the folder names, for example

cd "Documents and Settings\Users\XYZ\Documents\My Documents"

Once in the correct folder, use

htlatex filename.tex