Done System variable with TCC folder path

Oct 18, 2009
362
17
Have the installer create a system variable with the TCC folder path so other programs that require a full path can access it without the full path being hard coded, just %TCC_Dir%\tcc.exe (I do realize I can create one myself, but then it's "not standard".)

(I've just started doing a little bit with VBA and tried CALL Shell(). It works with the full path of an .exe but when I put in the full path of a .btm it doesn't accept it. I assume I'll need to include the path to tcc.exe.)
 
Aug 23, 2010
647
9
Use %ComSpec% to refer to the current interpreter.
And read documentation before assuming anything.
Either you don't have .BTM association, or you did not adjust PATHEXT to execute .BTM by the default shell.
 
Oct 18, 2009
362
17
I'm not looking to use whatever happens to be the current interpreter. What happened is I have both TCC/TCMD 21 and 22 installed. Instead of hardcoding the path for a particular TCC version I want to be able to use a system variable.

As I indicated, I know how to add a system variable, which I did. But that's one more custom step that has to be done with each install. I was able to screw with the VBA and get it to work--but I still think it's a good idea to have the system variable, especially when there are multiple TCC versions installed (TCC 21, TCC 22, TCC-RT).

(And the VBA didn't work with the system variable--but I didn't spend much time on it and it really doesn't matter for my purposes.)
 
Aug 23, 2010
647
9
Your purposes are uncommon - having multiple versions (or architectures) of the same program installed is a power user feature.
Having TCC-RT installer alongside other TCC variants is even more questionable. I suggest you use a VM if you want to run your scripts in TCC-RT for tests; that will be a more correct testing experience.
 
Oct 18, 2009
362
17
You're assuming I'm a developer with a power user machine. I'm not--I'm a lawyer (with no particular programming background ...) and the small firm still uses some DOS software, so we're limited to 32-bit Windows on 2009-era PC's. Plus, VM's would require multiple licenses for other software, etc., and be far beyond my abilities.
 
Aug 23, 2010
647
9
VirtualBox is free, and you can use trial versions of software for testing purposes. (This is, after all, what trial versions are for.)
And many "2009-era" systems have hardware virtualization support.
 
Aug 23, 2010
647
9
Code:
@ECHO OFF

SETLOCAL ENABLEEXTENSIONS

FOR %%F IN ("%ComSpec%") DO (
  SET CS_DIR=%%~dpF
)

ECHO %CS_DIR%

[C:\temp]$ xx.cmd
C:\Windows\System32\

[C:\temp]$ xx.btm
C:\Programs\TCC-RT\
 
Similar threads
Thread starter Title Forum Replies Date
R Declined Zero-padded date and time system variables, e.g., _monthzp, _dayzp, _doyzp Suggestions 20
R Declined Help system improvements Suggestions 11
Charles Dye Done Option to prevent recursion into System subdirectories Suggestions 0
R Done Add a .btm LIBRARY system Suggestions 12
rconn Done map the registry as a file system Suggestions 0
vefatica Declined Allow (require?) "0x" in environment variable type 3 (hex) Suggestions 6
Joe Caverly Done Have ESET modify Variable to corresponding type Suggestions 3
Alpengreis Done Suggestion for full osbuild internal variable Suggestions 2
D Done New internal variable _batchpath Suggestions 0
J Done Tooltips should show variable value Suggestions 12
R Done Changed variable window Suggestions 5
Joe Caverly Done Function that returns environment variable type Suggestions 1
R Done Redirect to a variable Suggestions 12
D Done Add the ability to control syntax coloring via an environment variable or some other way Suggestions 3
A @REALPATH variable function. Suggestions 0
rps Done TCC count internal variable Suggestions 12
M Declined Brief syntax for %@variable functions on TCMD status bar Suggestions 4
T Done _wintctitle variable Suggestions 13
vefatica Declined Loop on environment variable names? Suggestions 33
E Declined Add option to use SFN for ComSpec variable Suggestions 8
J Done Variable Name Completion Suggestion Suggestions 0
Joe Caverly Have TCMD/TCC support registered version of V Suggestions 14
R Talk to Amazon about having TCC-RT available on AWS Suggestions 0
Joe Caverly Launch TCC Tab with different date/time Suggestions 0
R Option to add tcc to Bash profile Suggestions 1
mfarah Declined Implement an "Add TCC to the task bar" in the TCMD installer. Suggestions 2
L Done Suggestion for TCC 'ver' command Suggestions 8
R TCC instance-specific clipboard Suggestions 0
M Declined DST date difference explorer/TCC Suggestions 2
Joe Caverly Declined 32-bit out-of-process servers from 64-bit TCC via PSHELL Suggestions 0
A [TCC-RT] Console-less script runner Suggestions 3
Joe Caverly Add a "Snippet" Menu to CMDebug and TCC Debugger Suggestions 0
Joe Caverly Add example .BTM code to TCC Debugger and CMDebug Suggestions 1
thorntonpg Done Goto folder in file explorer from the current directory in the tcc prompt Suggestions 7
rps TCC/TCMD instance expansion - TCC/TCMD info functions Suggestions 2
M TCC Install Updates Taskbar Link Suggestions 1
R Done Switch between TCC and RT on same PC Suggestions 1
G Declined make tcc being more "4dos" and win x64 faster Suggestions 7
rconn Some ideas related to TCC instances (limit, enumerate etc) Suggestions 0
rconn Declined Allow TC/TCC direct access to WinSock and other networking Suggestions 0
rconn Done extend tcc file format Suggestions 0
Roedy Done TCC Window title Suggestions 0
newbie Done Remove TCC from Cntrl-Pnl Recommended list Suggestions 10
R Declined REQ: Fullscreen mode for tcc. Suggestions 12
E Done TCC User/Administrator level in title bar Suggestions 2
R Declined TCC on a stick & PortableApps Suggestions 0
nickles Declined FR: New icon for TCC Suggestions 1
M Done Add a update command to TCC Suggestions 2

Similar threads