Hi All,
Thanks much for your help. I finally got it to work. Your advice was
spot-on; it was Windows that was giving me problems.
For posterity, this is how I finally got it to work on my Windows XP computer:
1) Create .bat file. (Jeph's no-bat method may work as well, this is
just the way I was successful).
My .bat file was:
Start/w "C:\Program Files\Stata10/wsestata.exe" "C:\Documents and
Settings\Dan\Desktop\STATA/DB_INVENTORY.do"
[note that I needed quotes around both filepaths, and did not need the
word do in between them]
You can test that your .bat file works by double clicking on it - it
should open stata and run your do file.
2) Go to Start->Accessories->System Tools -> Scheduled Tasks and
double click Add Scheduled Task.
3) Point the wizard toward your .bat file; set up timing etc.
4) Deal with these two key (no pun intended, statisticians) Windows quirks:
-You must have a password set for your account, and you must
enter it in during the Scheduled Task wizard setup. If your account
does not have a password, you need to add one for the task to work.
-If, after addressing the password issue, you still get the
characteristically cryptic error "0x80070005: Access is denied", go
to http://support.microsoft.com/kb/904423, click the Hotfix link at
the top of the page, and download the patch.
Thanks again for your help, folks.
-Dan
On Wed, Jun 11, 2008 at 6:52 AM, Jeph Herrin <[email protected]> wrote:
> The .bat file should work, but I think you can skip that
> step as long as your command is of the form:
>
> C:\Stata10\wstata.exe do mydofile.do
>
> Note the "do". It's also easier to tinker with the scheduled tasks
> if you go to File->New to create the task rather than use the
> wizard.
>
> hth,
> Jeph
>
>
> Dan Weitzenfeld wrote:
>>
>> This is helpful. My OS is Windows XP. I'm trying to tinker with the
>> properties of the scheduled task to get it to work... right now all
>> it does is pass the name of the do-file to stata in quotes, and Stata
>> responds by saying that it's not a valid command. Does anyone know of
>> a way around this?
>>
>> On Sat, Jun 7, 2008 at 7:01 PM, Jeph Herrin <[email protected]> wrote:
>>>
>>> I think you want the OS to do this, not Stata. You
>>> don't say what your OS is, in Linux see -at-, in
>>> XP use the scheduler (Start->Accessories->System Tools
>>> -> Scheduled Tasks on my setup, but yours may vary).
>>>
>>> I don't know about a Mac, though I assume OS X has a
>>> command line version of -at-.
>>>
>>> hope this helps,
>>> Jeph
>>>
>>>
>>> Dan Weitzenfeld wrote:
>>>>
>>>> Hi All,
>>>> Is there a way to have a do-file or program run at a given clock-time
>>>> every day, automatically?
>>>> I can think of a kluge, whereby the program is infinitely looping, and
>>>> if c(current_time) fits the desired criteria, the process runs.
>>>> I'm wondering if there is a more sane way to achieve this result?
>>>> Thanks in advance,
>>>> Dan
>>>> *
>>>> * 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/
>>
>> *
>> * 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/
>
*
* 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/