I think you painted yourself quite nicely in the corner with these strict requirements (what's wrong with "
screwing with the registry" ?)
Luckily there are some Windows (ahem) to escape through :-)
A few of them are already mentioned, but be aware that using "regular" TCC as a pass-through might cause global aliasses, functions, etc to "leak" into your TCC-RT and cause unpredictable results.
I can think of quite a few other ways to solve this, but most of them are not very "1991" as they require advanced registry trickery.
Here are the more straightforward ones that you might consider:
Visible differences between TCC and TCC-RT
This is the most straighforward one: put a BEEP and a PAUSE in the tcstart.btm of TCC-RT, use different screencolours, etc so you
know you are using the testversion and can change the file association if neccessary.
The titlebar gives you this information also, but that might be overlooked (or changed).
CMD as a switchboard
This one requires you to change the registry once.
Basically it associates .BTM files with a .CMD script (not CMD.exe ... a CMD script).
Then that script decides on criteria you specify (environment variable, flag file,...) what to start: TCC or TCC-RT
The CMD-script (based on my current paths and versions; tailor those to your situation):
C:\Temp\TEST_TCMD\FLIP.CMD
Code:
@echo off
IF exist c:\temp\RT.txt (
start "TCC RT 20" "C:\Temp\TEST_TCMD\CompleteVersies\RT_20.11.41\tcc.exe" /C %*
) ELSE (
start "TCC 20" "C:\Temp\TCMD20\tcc.exe" /C %*
)
Add this to your registry (Again: tailor to your situation):
Code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TCC.Batch]
@="TCC switchboard"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TCC.Batch\SHELL]
@="FLIPSWITCH"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TCC.Batch\SHELL\FLIPSWITCH]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TCC.Batch\SHELL\FLIPSWITCH\Command]
@="\"C:\\Temp\\TEST_TCMD\\FLIP.CMD\" \"%1\" %*"
Side-effect: FTYPE always shows the command specified in the default "Open" key, so it will report the wrong association. I could re-use the "Open" keyword, but that is where Take Command installations write. This way it can't be accidentally overwritten.
Now, if you double-click a .BTM in explorer, FLIP.CMD will be started (you can see that window flash very shortly on your screen) and that will start the correct TCC.exe.
A flipswitch on your desktop that changes and shows the current association state
( Based on
[title] )
This one changes the registry everytime, but shows you the state it is in (TCC or TCC-RT)
Instructions:
- Put this script somewhere on your system
- Change the settings in the script
- Start it once.
- It will create an icon on your desktop.
- From now on you can doubleclick this icon to switch between TCC an TCC-RT. The icon shows you the current association (green=TCC; red=TCC-RT)
If you remove the current TCC (-RT) version and install another one, the script will alert you (and show an exclamation mark icon too, to make you aware you have to change the settings.
The script uses FTYPE. You could also use FTYPE /U to change the setting in userspace
Code:
@echo off
echo on
setlocal
::==============[ SETTINGS ]===================
set LINKNAME=TCC association
set TCC=C:\Temp\TCMD20\TCC.EXE
set TCCRT=C:\Temp\TEST_TCMD\CompleteVersies\RT_20.11.41\tcc.exe
::==============[ END SETTINGS ]===============
rem assoc .btm=TCC.Batch
SWITCH "%_cmdspec"
CASE "%TCC"
ftype TCC.Batch="%TCCRT%" /c "%%1" %%*
SHORTCUT "%_batchname" "" "" "TCC Flip" "%USERPROFILE%\Desktop\%LINKNAME.lnk" 1 "C:\Windows\System32\imageres.dll" 100
echo.
echo. Don't forget to close all TCC's first
echo. to prevent "leaking" of global aliasses and other settings
echo.
pause
rem taskkill ....
CASE "%TCCRT"
ftype TCC.Batch="%TCC%" /c "%%1" %%*
SHORTCUT "%_batchname" "" "" "TCC Flip" "%USERPROFILE%\Desktop\%LINKNAME.lnk" 1 "C:\Windows\System32\imageres.dll" 101
DEFAULT
echo.
echo. "%_cmdspec" is not one of the options!
echo.
echo. Current options:
echo. %TCC
echo. %TCCRT
echo.
echo. Update this script (%_batchname)
echo.
SHORTCUT "%_batchname" "" "" "TCC Flip" "%USERPROFILE%\Desktop\%LINKNAME.lnk" 1 "C:\Windows\System32\imageres.dll" 102
pause
ENDSWITCH
Good luck and have fun!