windows task scheduler

For posts that don't quite fit into any of the other forums, including posts about these forums themselves.

Moderators: EViews Gareth, EViews Moderator

geyer
Posts: 11
Joined: Sun Mar 16, 2014 2:46 am

windows task scheduler

Postby geyer » Wed Oct 15, 2014 4:01 am

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

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

Re: windows task scheduler

Postby EViews Steve » Wed Oct 15, 2014 10:29 am

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

geyer
Posts: 11
Joined: Sun Mar 16, 2014 2:46 am

Re: windows task scheduler

Postby geyer » Tue Oct 21, 2014 8:48 am

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

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

Re: windows task scheduler

Postby EViews Steve » Tue Oct 21, 2014 9:24 am

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.

geyer
Posts: 11
Joined: Sun Mar 16, 2014 2:46 am

Re: windows task scheduler

Postby geyer » Thu Oct 23, 2014 7:49 am

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


Return to “Any Other Business”

Who is online

Users browsing this forum: No registered users and 1 guest