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

location of BAT/BTM properties in registry

Discussion in 'T&T - Miscellaneous' started by Roedy, Mar 25, 2014.

  1. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    You can configure the layout, colors and other properties for a bat file by right clicking on the top bar and selecting properties. I presume the information is stored somewhere in the registry, but I cannot find it. There appear to be a few sets of properties in computer\HKEY_CURRENT_USER\Console, but not one for each bat file. Does anyone know where they are stored? Part of what I am up to is trying to understand why colours don’t stay put the way I set them.
     
  2. TEA-Time

    Joined:
    Jun 2, 2008
    Messages:
    282
    Likes Received:
    1
    Windows saves those properties for console executables, not the BAT/BTM files (or any other type of file an executable might open).

    \HKEY_CURRENT_USER\Console contains settings from right clicking and choosing Default, and affects every console executable that doesn't have its own properties set.

    Choosing Properties changes the shortcut, if one was used, for the executable. Or a structure is created under \HKEY_CURRENT_USER\Console, for example \HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe, for an executable not started via a shortcut, such as a BAT/BTM association.
     
    #2 TEA-Time, Mar 25, 2014
    Last edited: Mar 25, 2014
  3. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    I don't understand you. That would mean all BTM files would have the same properties. They do not. Is there one set per *.lnk file?

    If you start a bat/btm file, does it look somewhere for the properties in either the registry or a *.lnk file?

    I have noticed that scheduled tasks have have their own properties. Yet starting a btm file from the TCC command line does not.
     
  4. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    This information is tentative. I have been doing some experiments, and here is my best understanding so far: When a bat/btm (Take Command) file is running, you can right click the bar at the top. Then you can configure the properties which includes options, Font, Layout and Colors. You might think Windows stores the properties for each bat file in some secret place, such as the registry, but it does not. It stores only one set of properties, common to all bat/btm files in the registry at Computer\HKEY_CURRENT_USER\Console. If you change the properties, you will change them for all bat/btm files.

    If you right click on a *.lnk shortcut, you can change the properties, but these are completely different from the ones you get when you click on a running bat/btm file. For example, they let you change the icon, which often does not take until a reboot.

    When a *.lnk shortcut is running, you can right click the bar at the top. Then you can configure the properties which includes options, Font, Layout and Colors. These will be private to just that shortcut. They are stored in the *.lnk file.

    Even if you invoke a bat/btm file directly via the bat/btm file, not the shortcut, or if you invoke it via the task scheduler, Windows is clever enough to find the corresponding shortcut on the desktop. How it does that I don’t know.

    I think it is necessary to have the same palette defined all your properties, otherwise when you select a colour, the screen will use a colour in some other property, but at the same offset. Even when you do that, often colours mysteriously change all by themselves. It is very frustrating. I think the whole scheme should be redone to give every bat/btm file its own properties, completely independent of any others. Perhaps my new understanding that only *.lnk not bat/btm files have properties may help sort it out.
     
  5. TEA-Time

    Joined:
    Jun 2, 2008
    Messages:
    282
    Likes Received:
    1
    Right, you've pretty much answered your own question.

    It's very basic. It's a function of Windows to save those properties, not TCC, which is why you don't get individual sets of properties for each BAT/BTM.

    So TCC.exe started with a shortcut will have its properties saved in the .lnk file, and TCC.exe started by association, such as double clicking on a BAT/BTM file, will have its properties saved in a subfolder of \HKEY_CURRENT_USER\Console.

    The properties stored directly in \HKEY_CURRENT_USER\Console are used for any console based program that doesn't have its own properties via the methods above, and they are set by selecting Default when right clicking the title bar of any console based program.

    Now, if you've set colors in TCC by typing OPTION and hitting Enter, that sets them for TCC only, but still not on an individual BAT/BTM basis.
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    Can you get BTM-specific properties (colors, say) by giving each BTM its own shortcut (LNKfile)?
     
  7. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    Yes, if the shortcut points to TCC.EXE. Not if the shortcut points to the batch itself.
     
  8. TEA-Time

    Joined:
    Jun 2, 2008
    Messages:
    282
    Likes Received:
    1
    Actually, here on Windows 7 64-bit anyway, I am seeing the shortcut to a BTM file get updated when I change some properties.
     
  9. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,883
    Likes Received:
    29
    That doesn't sound right (I haven't tried any of it). If the shortcut points to TCC.EXE, wouldn't the HKCU\Console\... settings be used?
     

Share This Page