Running a program w args

  • Thread starter Thread starter Ken Barz
  • Start date Start date
K

Ken Barz

I can use the windows "run" with the following command:

"C:\Program Files\SAS Institute\SAS\V8\sas.exe" -
sysin "c:\filetest\sas programs\spiroread.sas" -sysparm
c:\filetest\0254140.csv

where sas.exe is the application, the -sysin argument is
the SAS program to run, and the -sysparm argument is the
data it needs.

It runs great from the command line, but I've tried
following a few people's advice (to include that of the
SAS Institute) on how to get VB to run this, and I can't
seem to make it work.

Any ideas on what I need to do?
Thanks
 
Hi Ken,

Process.Start gets a process/application running.

The FilePath argument has a space so needs quotes around it. Inside a
string these must be doubled up.

Process.Start ("C:\Program Files\SAS Institute\SAS\V8\sas.exe", _
"- sysin ""c:\filetest\sas programs\spiroread.sas"" -sysparm
c:\filetest\0254140.csv")

Regards,
Fergus
 
* "Ken Barz said:
I can use the windows "run" with the following command:

"C:\Program Files\SAS Institute\SAS\V8\sas.exe" -
sysin "c:\filetest\sas programs\spiroread.sas" -sysparm
c:\filetest\0254140.csv

where sas.exe is the application, the -sysin argument is
the SAS program to run, and the -sysparm argument is the
data it needs.

It runs great from the command line, but I've tried
following a few people's advice (to include that of the
SAS Institute) on how to get VB to run this, and I can't
seem to make it work.

Have a look at the overloaded versions of
'System.Diagnostics.Process.Start' and the 'ProcessStartInfo' class.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Back
Top