keith
New Member
Posts: 3
|
Post by keith on Feb 10, 2021 11:12:06 GMT
This may be more of a Windows Task Scheduler question. I'm not sure.
I wrote a Just Basic program to cleanup a directory on my Windows 10 PC. The ".bas" file runs correctly. I also created a ".tkn" file. If I double click on the ".tkn" file in Windows it also runs correctly. The last thing the program does before terminating is create a log file. I scheduled the program to run once a week using the Windows Task Scheduler. However, when I execute the program from the task scheduler the program appears to run (task scheduler status is "running"), but it never terminates (should only take a second), nor does it create the log file.
Is there something different I need to do to properly execute a program from the Task Scheduler?
|
|
|
Post by tsh73 on Feb 10, 2021 13:21:21 GMT
Does your program supposed to run then computer logged on? Does it open any window at all? Could you just right click on sheduled task and make it run just now, just to see what's going on? If you change in your shedule line your program to say Notepad.exe, does Notepad.exe starts as supposed to?
|
|
|
Post by honky on Feb 10, 2021 15:16:52 GMT
sheduled task run ".exe" Run ".tkn"
|
|
keith
New Member
Posts: 3
|
Post by keith on Feb 10, 2021 15:40:48 GMT
Does your program supposed to run then computer logged on? Does it open any window at all? Could you just right click on sheduled task and make it run just now, just to see what's going on? If you change in your shedule line your program to say Notepad.exe, does Notepad.exe starts as supposed to? The task is set to run whether I'm logged on or not. And runs with the highest privileges. It does not open any windows. If I right-click on the task and select "run", the scheduler status changes to "running". Nothing else happens. The log file is not updated. I'm assuming that after an hour the scheduler will stop the task. I also created a separate task that runs one minute later to display the log file using notepad. That task does work.
|
|
keith
New Member
Posts: 3
|
Post by keith on Feb 10, 2021 16:12:27 GMT
Well, I believe I solved my problem. First, I discovered that the Task Scheduler does not automatically refresh itself. Therefore, the "running" status displayed in the scheduler won't change to "ready" unless you manually refresh the scheduler window.
Second, instead of trying to run the ".tkn" file directly from the scheduler I tried renaming the jbrun2.exe file and running that instead, which is probably what I should have done in the first place.
Anyway, it now seems to work as expected.
|
|
|
Post by tsh73 on Feb 10, 2021 17:44:48 GMT
Glad you make it. Nice thing to know it works, too.
|
|