Eviews launch options

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

DannyB
Posts: 14
Joined: Sat Dec 19, 2015 10:43 am

Eviews launch options

Postby DannyB » Tue Dec 22, 2015 7:57 am

Hi everyone,

I'm looking for a way to launch eviews from a python script in hidden mod or minimized mod.

Today i use this line in python : os.startfile('c:\Program Files\EViews 9\EViews9_x64.exe')

But i want to know i can i launch it with an option, for example : os.startfile('c:\Program Files\EViews 9\EViews9_x64.exe' -hidden) to not display eviews for the user.

Regards,

DannyB

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews launch options

Postby EViews Steve » Tue Dec 22, 2015 12:21 pm

I assume you are trying to run an EViews program when you launch it?

Try this:

Code: Select all

"C:\Program Files\EViews 9\EViews9_x64.exe" "c:\files\my.prg" /programonly
The "/programonly" option only works with EViews 9 and it will automatically shutdown EViews at the end of the program. You may have to get rid of the EXIT command at the end of your program if there is one.

Steve

DannyB
Posts: 14
Joined: Sat Dec 19, 2015 10:43 am

Re: Eviews launch options

Postby DannyB » Wed Dec 23, 2015 4:17 am

Actually im doing that :

Code: Select all

try: subprocess.call(["c:"+os.path.sep+"program files"+os.path.sep+"eviews 9"+os.path.sep+"eviews9_x86.exe", "exec", "prog1"]) except: subprocess.call(["c:"+os.path.sep+"program files"+os.path.sep+"eviews 9"+os.path.sep+"eviews9_x64.exe", "exec", "prg1"])
I call a subprocess from python tu launch Eviews x86/x64 an execute the programm "prg1" in the EViews Addins folder. In my program prg, at the end i have the "exit" function.

I tried exit and programonly options, but the same thing still remaining... The user can view starting EViews image and the GUI...

Nevermind, if i cant launch EViews in hidden mode i want to launch him un minimized tray.

Regards,

DannyB

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews launch options

Postby EViews Steve » Wed Dec 23, 2015 8:55 am

Danny:

Make sure you test your command line options with a Windows shortcut to the EViews executable first before trying to call it from Python. The /programonly option should work for you, but you may need to update your copy of EViews 9 to the latest version. Go to our eviews.com/download page to download the latest patch.

Also, we do provide a COM automation interface for using EViews has a hidden application. You can read about that from our whitepaper. I'm not familiar with Python myself, but I believe you can create and use COM objects. I found a "comtypes" library that might be useful here: http://starship.python.net/crew/theller/comtypes

Steve

johansamuelsson
Posts: 165
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: Eviews launch options

Postby johansamuelsson » Wed Oct 02, 2024 11:50 pm

Hi,

I’m running this batch code. As I understand it, Eviews should run without opening, but when I execute this line, Eviews opens. What could be wrong?

Code: Select all

"C:\Program Files\EViews 14\EViews14.exe" "C:\Temp\Test.prg" /programonly
Regards Johan

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews launch options

Postby EViews Steve » Thu Oct 03, 2024 1:19 pm

Put the "/programonly" argument first.

Code: Select all

"C:\Program Files\EViews 14\EViews14.exe" /programonly "C:\Temp\Test.prg"
This will launch EViews 14 (hidden), run the program, and then shutdown.

johansamuelsson
Posts: 165
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: Eviews launch options

Postby johansamuelsson » Thu Oct 03, 2024 9:17 pm

Thank you, Steve!

madm
Posts: 23
Joined: Mon Oct 23, 2017 1:13 pm

Re: Eviews launch options

Postby madm » Fri Jan 09, 2026 12:37 pm

I realize this is an old post, but I have a related question. When using the /programonly option, is there a way to put log output onto stdout or, if not, is there some other output command to do so?

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews launch options

Postby EViews Steve » Fri Jan 09, 2026 2:10 pm

EViews is still a Windows program, even if you run it with the /programonly option. This means there isn't a stdout that can be redirected.

Instead, I would recommend you use our LOGMODE command at the beginning of your program and specify the filename=file.txt & autosave=on options so you can see output in the specified file. LOGMODE can optionally display program lines, status line messages, any errors that occur, and explicit calls to LOGMSG.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests