Parameter %$ Different in Aliases and BTMa

Jun 2, 2008
376
2
Newton, MA
Is this WAD? With aliases, the parameter %$ is passed exactly as is. In a batch file, however, some processing is done. In particular, commas become spaces.

Code:
TCC(27.01.24): C:\temp>alias argalias
echo Arguments = %$

TCC(27.01.24): C:\temp>argalias $1,200
Arguments = $1,200

TCC(27.01.24): C:\temp>type argbtm.btm
echo Arguments = %$

TCC(27.01.24): C:\temp>argbtm $1,200
Arguments = $1 200
 
Jun 2, 2008
376
2
Newton, MA
Two more questions.
  1. Why is a comma not an argument separator in an alias?
  2. Is there any way with batch files to gain access to the entire command tail as entered? This is what I thought %$ meant.
As a workaround, I created a two-command alias wrapper for my batch file. The first command saved %$ to an environment variable, which the batch file could then use when called as the second command. I was trying to process numerical command-line arguments containing comma separators by removing the commas (and dollar signs, which I could do without any problem).
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,469
88
Albuquerque, NM
prospero.unm.edu
If you really want to see everything, you can examine the CMDLINE2 environment variable. But be warned, it really does contain everything everything. Multiple commands, redirection operators, variable references — everything.
 
Jun 2, 2008
376
2
Newton, MA
If I reference %cmdline2 in a batch file, the task hangs.

It looks as though I can use %@word[1-,%cmdline] to get the command tail as entered.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica Literal double quotes in SHORTCUT's "args" parameter? Support 6
T How can I send a simple parameter to a script, in tc 25? Support 2
M Backquoted parameters used in GoSub don't pass string as a single parameter Support 2
vefatica @TIMER's second parameter? Support 3
A Fixed v25 regression: Parameter expansion fails in piped commands Support 2
MikeBaas @regsetenv complains "wrong parameter" Support 14
D Envar _tcexit has value, even with /IX startup parameter Support 0
kb6ojs Make /G parameter persistent in COPY/MOVE command? Support 4
R Fixed Sendmail parameter /USER= does not work Support 4
vefatica "/" as parameter separator? Support 3
MickeyF create an alias with optional parameter Support 4
newgeekorder Debugger IDE - strange tab and parameter behaviour Support 1
fromano Invalid parameter 12.0.34 x64 Support 1
David McClelland TC10 - cdd /t gives invalid parameter Support 2
R @select inside alias gives different (insanely small) window Support 7
T Date format date different from cmd Support 7
Jesse Heines webform output different in ver. 26 than ver. 25 Support 2
Joe Caverly DrawVLine results different in TCMD tab and detached TCC Support 11
W If command - different with CMD Support 6
vefatica Are @FILEDATE[file] and @FILEDATE[file,u] ever different? Support 2
D Pasting Unicode data has different behavior on TCC and CMD Support 2
J How to? Start TCMD with different configurations Support 3
Glenn Bowes WAD TOOLBAR Button Definations are different v19 to v20 Support 8
M How to? Compare file timestamps accross different file systems... Support 1
deleyd Fixed Behavior different than CMD Support 1
C Screens of different size and hidden console Support 8
Stefano Piccardi TCC 13 vs. TCC 14 different FFIND /E"d$" output Support 1
beerns different results between tcmd and cmd Support 2
davidebbo Installing to a different machine Support 27
daniel347x Different results with TCC than with cmd.exe Support 2
B Need To Deactivate V12.1 Before Reinstall To Different Directory? Support 3
A Redirecting TCC output to a different RDP Session Support 6
B %ProgramFiles(x86)% returns different values in TCC and CMD Support 3
S MOVE to different drive Support 3
C sharing global histories between different TCMD versions? Support 5
dcantor LIST /X and TYPE /X give different results Support 20
T Different 9.02 TakeCmd.dll inikey files in the oldver directory Support 1
M Tab button to launch as different user Support 1
wbiebel Different versions? Support 1
Timothy Byrd COMSPEC incompatibility - v9 is different than v7 Support 8
vefatica Questions about aliases. Support 1
Jay Sage Request Re Aliases CD_LEAVE and CD_ENTER Support 2
Joe Caverly Expand all aliases on the command line Support 2
S Take Command crashes for aliases with length > 1015 Support 1
Joe Caverly SETLOCAL removes Aliases and Functions Support 3
vefatica Two @FUNCTIONs/aliases with the same name Support 4
D Can ANSI escape sequences be used in keystroke aliases? Support 8
Joe Caverly Documentation Aliases Overview Support 3
vefatica Display of special characters in aliases. Support 25
T aliases disappearing Support 22

Similar threads