`latex "\scrollmode\input foo.tex"`
Output files are always created in the current directory. When you fail to specify an input file name, TeX bases the output names on the file specification associated with the logical name TEX_OUTPUT, typically `texput.log`.