Starting Windows GUI programs from the command line...

May 24, 2010
Northlake, Il
Frankly, this is a question that is basically more just out of curiosity than a real problem because it's got an easy workaround, but I'd still like to know why the workaround is (sometimes!) needed.

The situation is quite simple: the following command: C:\Windows\System32\notepad.exe (which is really in an alias named NP but it's the same if run directly from the command line) causes the TCC session from which I start Notepad to "hang" until Notepad is closed. This doesn't happen all that often, but once it starts to happen it's completely consistent: every time I start Notepad from any TCC session that particular TCC session completely hangs (i.e. the command prompt doesn't happen and no commands can be issued/executed) until I close that instance of Notepad; and this is the case for every TCC session from which I start Notepad until Windows is rebooted.

And, yes, I know that if I execute the simple "enhancement" to the command "Start C:\Windows\System32\notepad.exe" that doesn't happen (frankly I and pretty much everyone else I figure would be shocked if it did), but it's a rather deep-down preference of mine to not do things that shouldn't have to be done, and this shouldn't have to be done.

- Dan

P. S. I've actually got an alias "FixNP=Alias NP=Start C:\Windows\System32\Notepad" to fix the Notepad issue if and when it occurs.:)


Scott Mintz
May 20, 2008
Solon, OH, USA
Although this doesn't answer your question, it does fall into the category of, "doctor it hurts when I do that. So don't do that then."

Make your NP alias always launch notepad via START. Since it's an alias, you won't care that it's doing a magic dance under the covers. You type NP and like magic, notepad runs and you get your prompt back. You won't ever need to run FixNP.

Assuming that Charles' suggestion doesn't lead to anything, you should see if typing NOTEPAD at a CMD prompt exhibits the same behavior. If Charles hit the nail on the head, then in the words of Emily Letella, "never mind."
May 24, 2010
Northlake, Il
Guys, thank you for your responses. And Charles, "Wait for External Apps" is not checked, and I would have been, again, frankly shocked because it is only Notepad that exhibits this behavior, it's not true for MS Word, Excel, Firefox, Internet Explorer, Opera, the "Magnify" app (which I am totally dependent upon), this Visual C++ compiler (which I'm trying to avoid using), all of the programs that I wrote myself (in C++ or Visual Basic), and pretty much anything else you can think of. (As I'm sure I've mentioned in the past, I basically don't use the Windows GUI at all because of my vision issues. Thank God (and Rex!:)) for TCC, I probably literally could not live without it.

And Scott, trying to run it from cmd.exe was a very good idea! And it had never occurred to me to even try it. (I really don't use cmd.exd) So I tried it there and cmd.exe does not hang.

Again, not a major problem because it's got an easy workaround; but very weird!!

- Dan

P. S. Just as an unrelated aside, I can't preview my postings at the moment because Firefox just "hangs" (although the "back" button works OK, thankfully). Because of my blindness, bad memory previewing is quite important to me so if there are stupid mistakes I apologize in advance.
May 24, 2010
Northlake, Il
And BTW, Scott, the reason I don't want to use the "Start" command is that it is my understanding starts a new (hidden) TCC session from which to run the GUI program. Since the TCC instance (now the new, hidden one) doesn't terminate after Notepad starts, it's sitting around taking up memory. And not taking up memory is very important to me; while this is a 32-bit processor with almost 4GB of RAM, since I tend to run a lot of apps concurrently - I've got a total of 17 apps running as of this minute, and that doesn't include the 5 TCC sessions running in my Take Command instance at the moment), running out of RAM causing the processor to do paging is very slow on this machine, presumably because of the pathetically slow disk drive. And if you wonder why I have that many apps (and TCC instances) running at one time, the reason(s) are very simple - my bad memory and glacial slowness as a result of same. If the app (or TCC instance) remains open, I actually remember what I was working on at any given time (be activating the app or TCC session and looking at it) and can rather quickly figure out where I left off. These are needs that the "typical" user probably doesn't have.

- Dan
May 20, 2008
Elkridge, MD, USA
If the START command is provided with sufficient information to locate NOTEPAD.EXE, it does not use a hidden instance of TCC to run NOTEPAD. This is the same information that is needed for starting NOTEPAD from the command line without the START command. So the alias suggested by Scott would not use more system resources.
As to your test running NOTEPAD from CMD, since you stated that not all instances of NOTEPAD run from the TCC command line cause TCC to wait, you need to try it from CMD multiple times, too! Is that what you did?


Staff member
May 14, 2008
And BTW, Scott, the reason I don't want to use the "Start" command is that it is my understanding starts a new (hidden) TCC session from which to run the GUI program.

That is never the case. You can force START to run TCC to run a GUI app, but (1) the TCC session will not be hidden, and (2) it's pointless because START can start an executable directly. The only time you need to start a TCC session first is if you are piping output (not the case with a GUI app), or you enter an alias or variable name that TCC has to expand first.
May 24, 2010
Northlake, Il
Thank you for the clarification, Rex. That means that my (habitual) concern was misplaced. As far as your comment goes re cmd.exe, that really wouldn't be a practical thing to do (which I didn't even think of, but that's no shock) because this is something that happens very rarely in TCC, literally weeks can go by without it happening at all (although, as I indicated, when it does start happening the only "cure" is to reboot Windows), although I will note that the fact that it was happening in TCC, for whatever reason(s), did not cause it to happen in cmd.exe. I'll fix the alias to put the "Start" into it (and most of my other aliases, too, while I'm at it).

And just to be clear about something, I was under the impression that "Start" started a TCC session that immediately terminated for GUI apps that didn't need TCC, whereas that TCC session "stuck around" for those things that required TCC to run (such as a .btm file, of course), but since I'd done that so seldom (as in probably never), I had never noticed that a visible TCC session is started in those situations.

And that brings me to some very basic questions (not to be taken in any way as complaints or criticism but which were the whole basis for my mis-impression in the first place): exactly what is the reason for the very existence of the "Start" command in the first place? It's clearly not needed for GUI programs (at least in the general case) which is indicated by the simple fact that I start all of my GUI apps from the command line without explicitly using "Start". I suppose it would be useful to run program that read from one file and write to another without any human interaction at all; but are those kinds of programs really that common? And in exactly what way are the "different" from GUI programs if they don't need a console? And would the "Start" command even do the job if they did need a console? (How would the start command even "know" that ahead of time?)_ Although when I look at the docs closely, it does offer a lot of options (none of which I've ever needed), but some of the options, at least, seem to at least imply that a TCC session (of some kind) is started. And this is reinforced (for me) by the fact that "Title" has no effect whatsoever (not really a surprise) for GUI apps; and I've really never run a non-GUI app any other way than from an (active) console.
It is useful for starting console apps in their own window. E.g., I have an alias "tcc" with the following value: start /pgm "C:\Program Files\JPSoft\TCmd13\TCC.exe". And, the various start options can be useful for starting both console and gui apps. E.g., I've used the priority and the INV options. And, I sometimes find it useful in btm files. In btm files, TCC always waits for the app to finish if you don't use start.
May 24, 2010
Northlake, Il
Dave, while I certainly don't disagree, because of the memory limitations of this machine that's something I would virtually never want to do. And I just sent an e-mail to a friend before checking here for any alerts (which is how I saw that you had entered this response) about how I had just Alt-Tabbed to Firefox and it took 47 seconds (since I was expecting this, I formally timed it with stopwatch on my cell phone) for it to come up, and the disk drive light was solidly on the whole time indicating it was pretty clearly a memory-swap operation. For this reason I absolutely do not want to use any virtual memory I don't have to use. (And because of my financial limitations due to my limited income due to my disabilities, I absolutely can not afford to buy a decent machine, which was the primary subject of the e-mail I just sent to my friend.) That's why I was trying to avoid using the "Start" command at all in the first place.

- Dan
Similar threads
Thread starter Title Forum Replies Date
C How to? starting TCC/TCMD v25 Support 2
samintz Starting Terminal from TakeCommand Support 3
vefatica Starting *.xlsm? Support 34
Steve Pitts _TCTAB when first starting Take Command Support 2
vefatica Starting Office apps Support 8
W Starting program for word to pdf conversion (difference cmd and tcc) Support 13
vefatica Starting Office 365 apps? Support 3
D WAD STARTing WUP apps Support 1
D Occasional TCMD 17 crash when starting additional TCC Support 4
D Folders pane display problem when starting Support 4
samintz Fixed DO /L with stringset starting with /n /e Support 2
C Fixed Starting editor from VIEW Support 9
ehab aboudaya WAD starting tcmd.exe with dir that has Boost C++ Libraries zip file delays Support 2
vefatica Starting shell objects Support 6
C starting TC/LE on the command line Support 1
C starting a shortcut from desktop Support 14
J starting in chosen directory Support 4
C starting tcmd with alternate INI file Support 15
F unexpected %1 while starting ide Support 6
T Starting a process blocks TCC window... Support 2
T Problem Starting Vim & gVIM Support 5
millardjk IDE dies without starting Support 4
S Starting TCC with double click on tab bar Support 0
thorntonpg windows 11 Support 12
vefatica Windows 10 themes Support 0
J Take command does not start on Windows 10 Support 3
D How to? Windows Key-Left and Windows Key-Right Support 9
Joe Caverly PYTHON from Microsoft Windows Store Support 2
D Open Windows 10 Photos app from command line Support 11
vefatica Windows Terminal ... Pop-up location Support 1
Joe Caverly Windows Terminal and @SELECT Support 13
vefatica Console popup windows don't work correctly Support 0
D Layout debugger windows Support 2
L LIST's pop-up search loses focus in a Windows Terminal window Support 15
nickles ANSI Colors Windows 7 no longer working Support 6
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
D Which is the latest version for Windows XP? Support 2
rconn News Windows 7 Support Support 0
Joe Caverly Windows Size is 80x0 Support 2
rconn Dropping Windows 7 support in Take Command / TCC v26 Support 8
G Taskbar Windows 10 Support 7
T Windows Terminal Support 2
Joe Caverly Windows Sensor Support 5
vefatica Windows 10 and line wrapping selection? Support 6 New Problem with later Windows 10 Support 10
CWBillow Upgrade Windows 10's effect on TCMD and TCC Support 3
T Take Command v21 on Windows Server Support 1
Bill de Haan "Sensitive Privilege Use" in Windows security auditing Support 7
Joe Caverly Create Windows Jobs and optionally attach processes to a job Support 17
Joe Caverly What version and Windows OS are you using? Support 3

Similar threads