By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Ctrl-C from within a library function

When I do a Ctrl-C while executing within a function from a library, current TCC seems to hang on the "Cancel batch job BatchName ? (Y/N/A) : y".

I put a PAUSE in the function and Ctrl-C on the PAUSE and it hangs.

I put a "ON BREAK EXIT" and it did exit.

Without the ON BREAK, Ctrl-C takes me to "Cancel batch job BatchName ? (Y/N/A) : y" and it freezes, the only thing I can do is to kill the current TCC process.
I did a little testing. It seems to depend on what the library routine is doing. "Cancel batch job ..." works fine it the library routine is doing internal stuff. It also works fine if the library routine is doing

2>nul %@execarray[a,schtasks /query /V]

But if the library routine is doing this

iff %@execarray[s,cscript //nologo //job:SVJOB "d:\data\tcclibrary\sv.btm?.wsf"] != 0 then
        echo cscript error
        goto done

TCC will disappear every time when Ctrl-C is pressed (and will occasionally be restarted by Windows).

Cgunhouse ... I'm curious ... what's the library routine doing?
The routine is going through directories using a "for /r"

I have a Cloud Sync directory that I copy files to, but rather than put the files in the directory I am putting a hard link to save on disk space. Before a file is copied (or a link is created) it test to see if the file is already a link to that file. If it is it moves on to the next file. If it isn't the file is deleted from the Sync Directory and a new link is created.

I'm actually having a hard time getting it to work, the Ctrl-C issue did help. Any ideas would be helpful.

Cap "Y" does seem to work, but I would have thought lowercase "y" would too.
[FOX] Ultimate Translator