Page 1 of 1

windows task scheduler

Posted: Wed Oct 15, 2014 4:01 am
by geyer
Hi!
I have a simple batch file which contains the following lines:
@echo off
cd "C:\Eviews User Objects\Eviews Work"
"C:\Program Files\EViews 8\EViews8_x64" executetask.prg
exit
double-click starts EViews and does the job properly. however, starting the batch file with the windows task scheduler doesn't do anything (i.e. Eviews does not even start).
( I've also tried "C:\Program Files\EViews 8\EViews8_x64.exe" executetask.prg in the third line)

is this a windows problem (I'm running "Win Server 2008 R2") or an EViews problem or something else?

Thanks for your help!

~~Alois

Re: windows task scheduler

Posted: Wed Oct 15, 2014 10:29 am
by EViews Steve
Alois:

First, make sure you don't have any instances of EViews 8 running in the background. Quit any running instances of EViews, then run the Windows Task Manager. If the task manager has a "Show processes from all users" button, click it, then look at list of programs sorted by their EXE name. Look for any running instances of "EViews8.exe" or "EViews8_x64.exe". If you find them, right-click each and select "End Task".

Next, in your DOS batch file, make sure you are specifying "EViews8_x64.exe" (WITH the .EXE extension) as the program to launch. Without the EXE extension, DOS will try to run our EViews8_x64.com file which doesn't seem to work in this scenario.

Now open your Windows scheduled task properties dialog and make sure the "Run only when user is logged on" option is selected. Also make sure the user account being used to run the task is your own Windows user account. Save these changes.

Now try running the task. With these task settings, you should see the EViews application window appear when it is launched by the batch file via the scheduled task.

Once you've confirmed that the task is working ok, my guess is that you will want change the task to run without you being logged in. Go back to the Task Properties dialog and change the radio button to "Run whether user is logged on or not" option. Leave the user account to still use your own account for now. This time when you save changes, Windows should be asking for your windows password.

Now try running the task again. With these settings, you won't be able to see the EViews window anymore because it is running under a different account (even though the account is the same one that you're currently logged into) -- but you should still be able to see it in the Task Manager. Verify that EViews8_x64.exe appears there and that you get your expected output. IMPORTANT: If the EViews program you are running does not have an "EXIT" command at the end, the EViews application will remain running and your batch file won't be able to continue until someone manually shutsdown the EViews application. You will have to manually "End Task" again to let the batch file continue. To prevent this, make sure your EViews program has an "EXIT" command as the last line.

Once you've gotten this working, you can try changing the task user account to be an account specifically created to be used by unattended tasks. This way you don't have to remember to update the task password every time you change your own Windows password. If you run into problems using the other user account, I would suggest searching for "Windows permissions Scheduled tasks" or "troubleshoot scheduled task" to get hints on how to resolve them.

Steve

Re: windows task scheduler

Posted: Tue Oct 21, 2014 8:48 am
by geyer
Steve:

thanks a lot for your comprehensive answer and sorry for the delay in my reply.
we've done what you suggested but the problem is not yet solved. I had planned to wait so that I could state "problem solved". however, that's not (yet) the case. I'll keep you posted.

~~Alois

Re: windows task scheduler

Posted: Tue Oct 21, 2014 9:24 am
by EViews Steve
It may help to try setting this up on a different computer, maybe one that isn't on your domain just so you can verify it all works in a different setting.

Re: windows task scheduler

Posted: Thu Oct 23, 2014 7:49 am
by geyer
Steve: problem finally solved. it was due to a (special) permission problem with a drive EViews tried to access (no task scheduler or EViews problem). thanks again for your help, and sorry for bothering you and the community!

~~Alois