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

SignUp Now!

Restart a batch file started in cmd in TCC(LE)

Start your batch file with the following, adjusting the TCC path to your system or defining an environment variable and using that instead. This fragment preserves any exit code set by a “quit #” statement.

Usage examples are svn hooks or Retrospect Backup event handler scripts, which explicitly look for .bat files and start them with cmd.exe.

On my systems, I symlink or junction “C:\Program Files\JPSoft\TCMD” or “C:\Program Files\JPSoft\TCCLE” to the current version, so any batch files don’t need to be adjusted every time I upgrade.
@echo off
if 01 == 1 goto tccstarthere
"C:\Program Files\JPSoft\TCMD\tcc.exe" /c %0 %*
exit /b %errorlevel%
Why not just change the file extension to .btm? Running tccbatch.btm as an Administrator will set the proper file association.
Sometimes you don't have control over the extension or the command processor. The backup client will only run RetroEventHandler.bat, not RetroEventHandler.btm. Svnserve includes .bat in its extension search list but not .btm, and explicitly starts the .bat with cmd.
You're comparing apples and oranges. "retro processor" will run RetroEventHandler.bat ? That's fine.
Call your RetroEventHandler.btm from it.
I hope, setting a file association is not outside of your control?
But for the love of God, do NOT name your scripts ".cmd", or even worse, ".bat", if they are not supposed to be run with CMD.EXE. Or COMMAND.COM.

Similar threads