Thanks Jeph, that is a big step forward for me. You still cannot pass around
such a program as not every user will want to edit his environment
variables, but for me, the problem is solved.
Martin Weiss
_________________________________________________________________
Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany
Fon: 0049-7071-2978184
Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130
Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131
SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jeph Herrin
Sent: Tuesday, May 27, 2008 6:59 PM
To: [email protected]
Subject: Re: st: path for winexec?
winexec uses the Windows PATH environmental variable to determine
where to look for executables. Some programs add their location
to the PATH when they are installed; I see on my computer that
Miktex did so, and that Adobe did not.
To check the path, open a command prompt and type -path-.
The PATH is a semicolon seperated list of folders; you can add
more folders to it, but there is a length limit.
You can add to the PATH variable at the command prompt with
PATH = "$PATH; M:\y New\Path"
but it only sticks around for that session. To add a folder
permanently, go to the control panel->System->Advanced. At
the bottom you'll see a button for the environmental variables;
click that, and in the bottom window fo the dialog that opens
you'll see, among others, PATH. You can edit that here.
hth,
Jeph
Martin Weiss wrote:
> Dear Statalisters,
>
> I am wondering whether there is a way to make Stata find executables on
its
> own. I usually have a smcl-log running and sometimes like to turn it into
a
> pdf (on a Windows machine). So I have it translated to ps and then let
Stata
> -winexec- the ps2pdf from the Miktex distribution. After conversion, I
want
> the file to be displayed automatically, so the code looks like this:
>
> ***********************
> -my commands-
>
> log close
> translate "mylog.smcl" "C:/Users/`c(username)'/Desktop/mylog.ps", replace
> translator(smcl2ps)
> !ps2pdf mylog.ps
> winexec "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
> "C:/Users/`c(username)'/Desktop/mylog.pdf"
> ***********************
>
> I have generalized the file to run on different machines without a
> requirement for any tweaking. The only missing link is the path to the
> reader exe in the last line. I am wondering why Stata is able to find the
> ps2pdf exe but not the reader. Is there a way to have it do that as well?
I
> thought about putting it into the profile.do, but that would merely shift
> the onus to the profile without solving the problem...
>
> Any ideas?
>
> Martin Weiss
> _________________________________________________________________
>
> Diplom-Kaufmann Martin Weiss
> Mohlstrasse 36
> Room 415
> 72074 Tuebingen
> Germany
>
> Fon: 0049-7071-2978184
>
> Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130
>
> Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131
>
> SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945
>
>
>
> *
> * 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/