OPTION //directive=value is a ENDLOCAL

that means, it destroy the local Aliases and Functions and switch to global.

This was not the case last week, so it must have been installed with the last 3 or 4 builds.
I've wonder, that an Local defined Alias in my script suddenly never worked.

The following script demonstrate the problem, it defines Aliases in the SETLOCAL / ENDLOCAL block
wich will not more present after the OPTION Command, but the next alias definition after the
OPTION command will store in global Memory.
Code:
OPTION //ErrorColors=Bright Yellow on Bright Red

Color Black on Bright Yellow
Ver /R

Function /G
Function IsFunction=%%@IF[ISFUNCTION %%1,TRUE,FALSE]
Function IsAlias=%%@IF[ISALIAS %%1,TRUE,FALSE]
::
Alias PrintLineW=`Echo %@REPEAT[%1,%@DEC[%_COLUMNS]]`
::
Echo Alias PrintLineW ist %@ISALIAS[printlinew]
EchoS Alias PrintLineW: & Alias PrintLineW
PrintLineW *
::
Echo Aliaslist: & Alias
Echo Functionslist: & Function
:::::::::::::::::::::::::::::::::::::::
Setlocal
  UnAlias *
  UnFunction *
  Alias localPrintLineW=Echo %%@REPEAT[%%1,%%@DEC[%%_COLUMNS]]
  Function localIsFunction=%%@IF[IsFUNCTION %%1,TRUE,FALSE]
  Function localIsAlias=%%@IF[IsALIAS %%1,TRUE,FALSE]
  Echo Alias localPrintLineW ist %@localISALIAS[localprintlinew]
  EchoS Alias localPrintLineW: & Alias localprintlinew
  localPrintLineW +
  Echo Aliaslist: & Alias
  Echo Functionslist: & Function
  Memory | TAIL /N+16
    OPTION //BatchEcho=No & OPTION BatchEcho
  Memory | TAIL /N+16
  Echo Aliaslist: & Alias
  Echo Functionslist: & Function

  Echo Alias localPrintLineW ist %@localISALIAS[localprintlinew]
  EchoS Alias localPrintLineW: & Alias localprintlinew
  localPrintLineW #
  Alias localPrintLineW=Echo %%@REPEAT[%%1,%%@DEC[%%_COLUMNS]]
EndLocal
Echo Aliaslist: & Alias Local*
Echo Functionslist: & Function Local*
localPrintLineW !
 
Last edited:
May 20, 2008
11,400
99
Syracuse, NY, USA
This will do it too. (What is ZoneId anyway?).

Code:
v:\> type test.btm
setlocal
unalias *
alias foo=bar
echo Before:
alias
option //ZoneId=0
echo ========^r^nAfter:
alias | head /n2

Code:
v:\> test.btm
Before:
foo=bar
========
After:
hexe=d:\HWorks6\HWorks32.exe %$
e=textpad
 
Similar threads
Thread starter Title Forum Replies Date
D Bug TCMD /X option Support 6
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
D Purpose of DIRHISTORY /N option Support 2
Charles Dye Does HASH's /E option do anything? Support 1
Charles Dye ASSOCIATE loses /P option Support 4
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
thorntonpg option /u not working The directory name is invalid Support 5
rps TCMD Tabs priority option setting Support 0
A How to? TCMD Configuration Dialog: 'Smooth Scrolling' Option missing? Support 1
A Fixed (CMD compat) START /D fails to recognize the switch option. Support 3
R Fixed 7ZIP Compression Method Option Doesn't Work Support 1
D everything /o does not open the option dialog Support 4
fishman@panix.com How do I make the selections in the option menu sticky? Support 23
vefatica OPTION /U Support 2
cgunhouse Foldermonitor with "/E" Option Issue Support 6
cgunhouse Foldermonitor with /W option Support 10
Alpengreis TCC-Option for EnableDelayedExpansion (!var!) problem Support 15
D The BatchEcho option Support 8
D /extract: option for the installer Support 4
fishman@panix.com Why are the OPTION settings not sticky??? Support 11
vefatica OPTION /U Support 1
vefatica TPIPE's /perl option? Support 1
I TC "Registering" but NOT Registering, Now Hung on TCMD Option Screen Support 2
cgunhouse IFTP "/S" Option Support 6
Alpengreis [TC 17.x] Install with "option /u" failed Support 5
cgunhouse Jabber Command Line Option Being Transmitted -- Fixed with Build 42 Support 2
Charles Dye OPTION dialog appears underneath Take Command window Support 4
Charles Dye OPTION /U, private beta to public Support 4
Alpengreis WAD Command "MSGBOX /?" does not show option /N Support 2
Phileosophos Fixed Option Dialog Hangs when Using Help Support 7
M Web Help option in Take Command 15 broken? Support 3
fpefpe How to? start command /tab option/switch Support 6
S How to? Find installer downloaded by "option /u"? Support 11
W /g option (%) on MOVE cmd appears broken TCC 14.03.57 x64 Support 8
Charles Dye Odd behavior after using OPTION "Advanced" tab Support 2
noahcoad Option to always CALL? Support 4
fishman@panix.com Option: Updates broken in Build 36 Support 3
S option /u question Support 19
R CompleteAllFiles missing in option? Support 1
vefatica I'd *always* like the "Preview" option Support 5
S Directory history entries from /S option of various commands Support 2
Stefano Piccardi INIQuery option Support 1
M Missing PDir option... Support 5
vefatica OPTION /U Support 6
Jay Sage Version 12: No Option to Configure Toolbar Support 2
nickles OPTION "trims" long ColorDir directive Support 1
D Copy /n option order Support 5
G tcmd v11 installation option for pinning to taskbar Support 3
Joe Caverly START and the /TAB option Support 0

Similar threads