|
Thanks for all the responses. After testing, the only one
that close to work is null suggested systask command. It can
start the app.exe and close it. Unfortunately, it seems
to treat the /swithes differently from apppath\app.exe
method, so I still can't use it.
Here is a summary:
1. works, but need to specify path, which is a burden for user
when they don't know where the app.exe is located.
options xsync xwait;
x """&apppath\app.exe"" /swithes ""&outpath\filename""";
2. can start app.exe without having to specify the path,
but won't close the DOS window.
options xsync xwait;
x "start app.exe /switches ""outpath\filename""";
3. can start app.exe and close the DOS window, but failed
to achieve the goal due to /switches not being honored.
systask command "start app.exe /switches ""outpath\filename""";
4. add cmd /c per Kevin does not make difference.
So, looks like I have to stick on method 1.
Ya
PS. the app.exe is acrodist.exe, Acrobat distiller.
Different version is installed at different location.
-----Original Message-----
From: Data _null_; [mailto:iebupdte@gmail.com]
Sent: Wednesday, July 14, 2010 4:50 AM
To: Huang, Ya
Cc: SAS-L@listserv.uga.edu
Subject: Re: x "path\app.exe" vs x "start app.exe"
Perhaps SYSTASK or INFILE PIPE would be better. I "never" use X.
Sounds like a job for SYSTASK, but PIPE will also work. Depends on the
command and how the output is produced and used.
systask command 'start notepad.exe' nowait;
/* This data step runs the entire time the application is running which
for NOTEPAD may not be desireable*/ data _null_;
command = 'start notepad.exe test.sas';
infile dummy pipe filevar=command;
input;
stop;
run;
I would be good to know more the application your are starting.
On 7/13/10, Ya Huang <ya.huang@amylin.com> wrote:
> Hi there,
>
> I need to run some apps with x command. I have two ways to run it:
>
> 1.
> options xsync xwait;
> x """&apppath\app.exe"" /swiths ""&outpath\filename""";
>
> 2.
> options xsync xwait;
> x "start app.exe / ""outpath\filename""";
>
> For 1., I have to specify the apppath, which is not always in the same
> place.
> For 2., advantage is that I don't have to specify the apppath, windows
> can find the app.exe automatically. disadvantage is the DOS window
> won't close. I can't use noxsync and noxwait before the x command.
>
> I would prefer start method, if there is a way to close the dos
window.
> I tried x "exit"; and failed.
>
> Thanks
>
> Ya
>
|