Statalist The Stata Listserver


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

RE: st: Windows batch mode not working


From   "Earnhart, Benjamin J" <[email protected]>
To   <[email protected]>
Subject   RE: st: Windows batch mode not working
Date   Tue, 19 Dec 2006 20:39:44 -0600

I created a batch file containing the two lines below:

cd c:\data
C:\Progra~1\Stata9\wstata.exe do somedofile.do

and in the .do file, I have as the last line:
exit, clear STATA

and it works for me.  Dunno if my progra~1 instead of quotation marks
around program files does anything, but seems to avoid one layer of
possible complications.  Also when I use the /e or /b switches, I get
errors.  But w/out them it works, so try it without those switches.



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Neil Shephard
Sent: Tuesday, December 19, 2006 5:34 PM
To: [email protected]
Subject: Re: st: Windows batch mode not working

No real insight here as I use Stata under an alternative OS, but it
might help if you open a log-file within your do-file so that you can
see how far your analysis is getting.

On 12/20/06, Bednar, Paul <[email protected]> wrote:
>
> 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.

I suspect that using quotes around file-paths with spaces in (as you
did in the first example) would probably help resolve the "Can't find"
problem.

Neil
>
> 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/
>


-- 
"Doing science for the money is like having sex for the exercise." -
Matt (BistroMath - slashdot.org)

Email - [email protected] / [email protected]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
*
*   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/

*
*   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