1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Buttons and _cwd

Discussion in 'Support' started by liguorid, Dec 20, 2010.

  1. liguorid

    Joined:
    Feb 25, 2010
    Messages:
    5
    Likes Received:
    0
    I am once again confused about the (relatively) new style of buttons in Take Command. In TCMD 11 when I run the command "cdd /t %_cwd" the result is what I intend, namely to switch the folder view's current directory to the same as the command window's. When I insert it into a button, however, _cwd always expands to the directory in which Take Command is installed. For example, if I say "cdd c:\" with the expected result then click on my button, it inserts the command "cdd c:\apps\tcmd11" onto the command line. If the button says '"cdd /t %_cwd" enter' it immediately switches both views to the Take Command directory. What's going on here?
     
  2. liguorid

    Joined:
    Feb 25, 2010
    Messages:
    5
    Likes Received:
    0
    Never mind, I've got it now. %_cwd puts the value of the variable on the command line, whereas %%_cwd puts the string %_cwd on the command line which gets expanded upon execution. It's still not clear to me where _cwd is getting the values assigned to it using just one "%", but two works.

    It occurred to me while working in the button dialog box that checking the "change folder directory" and not passing any command at all might do what I wanted, but it doesn't. I have no idea what it does do.

    What would really be useful is if clicking on the folder view changed the working directory of the command window, without dragging/dropping or worrying about what's already on the CL. Is that doable, desirable, or useful to anyone else?
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    If you have a single %, it gets expanded immediately inside TCMD, and it will be assigned TCMD's current directory (which is probably not the same as TCC's current directory).

    It's not doable for anything other than a TCC tab window, and is problematic even there as some operations will not be happy to have the current directory changed unexpectedly.
     

Share This Page