Weird interaction with Task Scheduler

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 29, 2008
517
3
Groton, CT
#1
Windows XP Pro SP3, TCC 10.00.61

Since I upgraded to build 61, all my scheduled tasks which run TCC have been failing. I cannot positively state that it's TCC that's at fault, but I think so, and I'm asking if anyone else has a similar problem.

I have a scheduled task whose command line is

"C:\Program Files\JPSoft\TCMD10\tcc.exe" /C C:\work\test.bat >> test.log

This worked correctly with all builds before this one. By running correctly, I mean it runs TCSTART.BAT, then runs TEST.BAT, appending the output to TEST.LOG, and then runs TCEXIT.BAT.

Now it's failing by running TCSTART.BAT, issuing the command to run TEST.BAT, but TEST.BAT never runs, the next thing in the log is TCEXIT.BAT.

If I removed the ">> test.log", the job will run correctly (but output is to its console window).

I've tried putting parentheses in these ways:
(C:\work\test.bat >> test.log)
(C:\work\test.bat) >> test.log

Neither of these have any effect.

I've escaped the > marks with ^>^>, and then TEST.BAT runs, but it doesn't output to the log file.

Can anyone else verify this behavior?
 
#2
dcantor wrote:
| Windows XP Pro SP3, TCC 10.00.61
|
| Since I upgraded to build 61, all my scheduled tasks which run TCC
| have been failing. I cannot positively state that it's TCC that's at
| fault, but I think so, and I'm asking if anyone else has a similar
| problem.
|
| I have a scheduled task whose command line is
|
| "C:\Program Files\JPSoft\TCMD10\tcc.exe" /C C:\work\test.bat >>
| test.log
|
| This worked correctly with all builds before this one. By running
| correctly, I mean it runs TCSTART.BAT, then runs TEST.BAT, appending
| the output to TEST.LOG, and then runs TCEXIT.BAT.

I am derelict in updating, still at B57, and I have no scheduled TCC
sessions, so I cannot test for the problem. However, I can suggest a
work-around, namely, an additional batch-file layer, a one-liner:

TEST_DRIVER.BTM:

C:\work\test.bat >> [path]test.log

Another alternative is to use a special version of TCSTART, which can end
with the two lines below:

C:\work\test.bat >> [path]test.log
exit

BTW, if TEST.BAT needs to be runnable by CMD.EXE, I can understand why it
has .BAT extension. However, TCSTART and TCEXIT are run only by TCC, so
using the .BTM extension would reduce the startup and termination time of
EVERY TCC session, including those in pipes.
--
HTH, Steve
 
May 29, 2008
517
3
Groton, CT
#3
BTW, if TEST.BAT needs to be runnable by CMD.EXE, I can understand why it
has .BAT extension. However, TCSTART and TCEXIT are run only by TCC, so
using the .BTM extension would reduce the startup and termination time of
EVERY TCC session, including those in pipes.
Thanks for the work-arounds. I'm aware of them, but I still want to run down what's wrong.

As far as the extension goes, the startup and rundown times are not important, but thanks for the suggestion.
 
#4
I tried a similar scheduled task (XP/SP3 - TCCv10.00.61):

D:\TCMD10\tcc.exe /c foobat.bat > footext.txt
Start in d:\tcmd10

... made sure foobat.bat was there. It worked. Then I changed ">" to ">>" and
it worked again.


On Sat, 21 Mar 2009 19:20:16 -0500, dcantor <> wrote:

|Windows XP Pro SP3, TCC 10.00.61
|
|Since I upgraded to build 61, all my scheduled tasks which run TCC have been failing. I cannot positively state that it's TCC that's at fault, but I think so, and I'm asking if anyone else has a similar problem.
|
|I have a scheduled task whose command line is
|
|"C:\Program Files\JPSoft\TCMD10\tcc.exe" /C C:\work\test.bat >> test.log
|
|This worked correctly with all builds before this one. By running correctly, I mean it runs TCSTART.BAT, then runs TEST.BAT, appending the output to TEST.LOG, and then runs TCEXIT.BAT.
|
|Now it's failing by running TCSTART.BAT, issuing the command to run TEST.BAT, but TEST.BAT never runs, the next thing in the log is TCEXIT.BAT.
|
|If I removed the ">> test.log", the job will run correctly (but output is to its console window).
|
|I've tried putting parentheses in these ways:
|(C:\work\test.bat >> test.log)
|(C:\work\test.bat) >> test.log
|
|Neither of these have any effect.
|
|I've escaped the > marks with ^>^>, and then TEST.BAT runs, but it doesn't output to the log file.
|
|Can anyone else verify this behavior?
|
|
|
|
--
- Vince
 
May 29, 2008
517
3
Groton, CT
#5
I tried a similar scheduled task (XP/SP3 - TCCv10.00.61):

D:\TCMD10\tcc.exe /c foobat.bat > footext.txt
Start in d:\tcmd10

... made sure foobat.bat was there. It worked. Then I changed ">" to ">>" and
it worked again.

Thank you, Vince. This is a real puzzle; I didn't install any other software other than TCC build 61 before the scheduled jobs started failing.

No TCC bug report here. At least not yet.
 
May 29, 2008
517
3
Groton, CT
#6
I found the problem, and it was my own fault.

Duh.

Several hours before I upgraded to build 61, I added this line to TCSTART.BAT:

Code:
echo %_isodate %_time %_pid %_ppid %cmdcmdline >> \tcc.log
Because %cmdcmdline% itself contained ">>", executing that echo command caused an error because the target (\tcc.log) was already open. It turns out that the error appears to be fatal.

My fix was to put quote marks like this around "%cmdcmdline" in the echo command.

Duh. What a dumb mistake!

I didn't notice the problem before I upgraded because no scheduled task was run between the time I inserted the echo command and the time I upgraded to build 61.

However, it led me to do a little test.

I created two files, a and b, like this:

touch /da a
touch /da b

Then,

echo foo >> a >> b
resulted in an error
TCC: (Sys) The process cannot access the file because it is being used by another process. "C:\work\a"

I know that's illegal syntax, but perhaps it could be detected with a better error message.

Also any attempt after that to access file a results in the same error message until the TCC session is closed.