Command-line parameter for TitleExtraText option

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
amach
Junior Member
Junior Member
Posts: 41
Joined: 2003-04-09, 14:23 UTC
Location: Brazil

Command-line parameter for TitleExtraText option

Post by *amach »

I often connect to a VPN and run some programs using my remote credentials, so I need to use the command

Code: Select all

C:\Windows\System32\runas.exe /netonly /user:DOMAIN\username "program"
to run them. So, instead of doing so for each of those programs, I added them to TCMD button bar and I run TCMD with runas. But if I run two instances of TCMD, one using local credentials and other using remote credentials, there's no way to know which is which, except for the instance number (and I need to remember which number is each one). I didn't want to have two wincmd.ini files just to set different TitleExtraText settings for each, so I'd like to ask for a command-line parameter to override the ini setting. With that, I can set it in the shortcut I use to launch TCMD with remote credentials.
If you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved. (Romans 10.9)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48074
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Command-line parameter for TitleExtraText option

Post by *ghisler(Author) »

Aren't there any environment variables which are different between the two?
TitleExtraText supports environment variables like %USERNAME%. Just run cmd.exe and use the command
set
to view a list of all environment variables.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Command-line parameter for TitleExtraText option

Post by *Usher »

2amach
Have you tried to use start command? It supports "title" as a parameter for a window.
Andrzej P. Wozniak
Polish subforum moderator
amach
Junior Member
Junior Member
Posts: 41
Joined: 2003-04-09, 14:23 UTC
Location: Brazil

Re: Command-line parameter for TitleExtraText option

Post by *amach »

Usher wrote: 2019-02-21, 21:36 UTC 2amach
Have you tried to use start command? It supports "title" as a parameter for a window.
Yes, unfortunately it doesn't work. No matter what you put in "title", it isn't shown in TCMD title.
If you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved. (Romans 10.9)
amach
Junior Member
Junior Member
Posts: 41
Joined: 2003-04-09, 14:23 UTC
Location: Brazil

Re: Command-line parameter for TitleExtraText option

Post by *amach »

ghisler(Author) wrote: 2019-02-21, 15:16 UTC Aren't there any environment variables which are different between the two?
TitleExtraText supports environment variables like %USERNAME%. Just run cmd.exe and use the command
set
to view a list of all environment variables.
I'll give it a try. Even if there's no available environment variable to tell them apart, I can set a new one just before starting TCMD. I didn't know that the option supports them.

Thanks a lot.
If you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved. (Romans 10.9)
amach
Junior Member
Junior Member
Posts: 41
Joined: 2003-04-09, 14:23 UTC
Location: Brazil

Re: Command-line parameter for TitleExtraText option

Post by *amach »

amach wrote: 2019-02-26, 15:52 UTC
ghisler(Author) wrote: 2019-02-21, 15:16 UTC Aren't there any environment variables which are different between the two?
TitleExtraText supports environment variables like %USERNAME%. Just run cmd.exe and use the command
set
to view a list of all environment variables.
I'll give it a try. Even if there's no available environment variable to tell them apart, I can set a new one just before starting TCMD. I didn't know that the option supports them.

Thanks a lot.
Well, it worked. I just had to create a batch script to set the variable and call TCMD, and then call that script using runas.exe (because runas.exe starts a new environment and, thus, any variable created before it won't be available in that new environment).
If you confess with your mouth Jesus as Lord, and believe in your heart that God raised Him from the dead, you will be saved. (Romans 10.9)
Post Reply