Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Windows batch mode not working


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Windows batch mode not working
Date   Wed, 20 Dec 2006 10:06:29 -0500

Paul--
This is a Win question, not a Stata one.

To run a program in DOS or Windows that is not in a directory in the
%PATH%, you need to specify its path which in your case seems to be
"C:\Program Files\Stata9\wstata"
but
"C:\Program Files\Stata9\" wstata /e do c:\data\outstata7.do
attempts to run the program "C:\Program Files\Stata9\"
and
C:\Program Files\Stata9\wstata /e do c:\data\outstata7.do
attempts to run the program "C:\Program"
i.e. the first token is the program.

So
"C:\Program Files\Stata9\wstata" /e do c:\data\outstata7.do
should work.
But I have not tested it.

In general, it's a good idea to use directories and file names without
spaces or special characters, and 8 characters or fewer, for ease of
use and backwards compatibility.  Why Micro$oft felt it necessary to
use defaults like "Program Files" and "My Documents" instead of
"programs" and "docs" is beyond me.

On 12/19/06, Bednar, Paul <[email protected]> wrote:
Dear Statalisters,

I'm unable to successfully run a batch file in Windows XP following this
link: http://www.stata.com/support/faqs/win/batch.html.

This is frustrating because the batch file runs perfectly when I have a
Stata session open and run it from the command line.

First, I cd to the directory where Stata9 is installed: C:\Program
Files\Stata9\.  Next I type wstata /e do c:\data\outstata7.do.  I see
the Stata command window appear, vanish, and the Windows command line
appears indicating the batch is complete.  However, the batch doesn't
execute.

I've tried cd'ing to where the batch file resides (C:\data) and have
typed:
"C:\Program Files\Stata9\" wstata /e do c:\data\outstata7.do.  The
results are the same as the prior paragraph.

The above link requires the user to enter the command after clicking the
Start button and selecting "Run".  This hasn't worked either because if
I enter the following in the text box: C:\Program Files\Stata9\wstata /e
do c:\data\outstata7.do Windows gives an error saying it can't find
C:\Program.  If I leave off the install directory path, Windows gives an
error that it can't find wstata.

Any insight is greatly appreciated.

Cheers,
Paul
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index