Questions tagged [console-application]

A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems (Unix, DOS, etc.) or the text-based interface included with most Graphical User Interface (GUI) operating systems, such as the Win32 console in Microsoft Windows, the Terminal in Mac OS X, and xterm in Unix.

A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems (Unix, DOS, etc.) or the text-based interface included with most Graphical User Interface (GUI) operating systems, such as the Win32 console in Microsoft Windows, the Terminal in Mac OS X, and xterm in Unix. A user typically interacts with a console application using only a keyboard and display screen, as opposed to GUI applications, which normally require the use of a mouse or other pointing device. Many console applications such as command line interpreters are command line tools, but numerous text-based user interface (TUI) programs also exist.

As the speed and ease-of-use of GUI applications have improved over time, the use of console applications has greatly diminished, but not disappeared. Some users simply prefer console based applications, while some organizations still rely on existing console applications to handle key data processing tasks.

7241 questions
26
votes
5 answers

How to use MemoryCache in C# Core Console app?

I would like to use the Microsoft.Extensions.Caching.Memory.MemoryCache in a .NET Core 2.0 console app (Actually, in a library that is either used in a console or in a asp.net app) I've created a test app: using System; namespace ConsoleTest { …
remcolam
  • 505
  • 1
  • 5
  • 10
25
votes
12 answers

AttachConsole(-1), but Console.WriteLine won't output to parent command prompt?

If I have set my program to be a Windows Application, and used the AttachConsole(-1) API, how do I get Console.WriteLine to write to the console I launched the application from? It isn't working for me. In case it is relevant, I'm using Windows 7…
Merlyn Morgan-Graham
  • 58,163
  • 16
  • 128
  • 183
25
votes
4 answers

What happens when you close a c++ console application

I guess the question says it all, but, what happens if someone closes a c++ console app? As in, clicks the "x" in the top corner. Does it instantly close? Does it throw some sort of exception? Is it undefined behavior?
rlbond
  • 65,341
  • 56
  • 178
  • 228
24
votes
1 answer

Running console applications on other monitor

I am using Visual Studio. I have a solution which contains 2 console application projects. When I pressed run they are appearing on the same screen with Visual Studio. But I need to see console outputs on the other screen which doesn't have Visual…
uzay95
  • 16,052
  • 31
  • 116
  • 182
24
votes
4 answers

What is the difference between getch() and getchar()?

What is the exact difference between the getch and getchar functions?
bubble
  • 3,408
  • 5
  • 29
  • 51
24
votes
5 answers

How to stop/exit/terminate dotnet core HostBuilder console application programmatically?

I'm trying to create a dotnet core console app. The app is a simply utility app and should start, do its thing and exit. It's easy to achieve using standard console application template generated by Visual Studio. But these days we have HostBuilder…
rook
  • 2,819
  • 4
  • 25
  • 41
24
votes
2 answers

How to cleanly shut down a console app started with Process.Start?

This is looking like an impossible task. Absolutely nothing I've found works. The question is how to cleanly close a console application started with Process.Start that has been started with no console window and without using shell execute:…
Triynko
  • 18,766
  • 21
  • 107
  • 173
24
votes
6 answers

Is it possible to build a Console app that does not display a console Window when double-clicked?

Related: Should I include a command line mode in my applications? How to grab parent process standard output? Can a console application detect if it has been run from Explorer? I want to build a console app, that is normally run from the command…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
24
votes
4 answers

Changing Console Window's size throws ArgumentOutOfRangeException

I am trying to set the size of the Console Window in a c# console application. I get an ArgumentOutOfRangeException with this message: The value must be less than the console's current maximum window size of 41 in that dimension. Note that this…
msbg
  • 4,852
  • 11
  • 44
  • 73
23
votes
4 answers

How can I get list of open tabs in Firefox via a command-line application?

I have a lot of tabs open in Firefox. After I close Firefox and then run it again, the tabs are there. That's all right. However, from time to time, Firefox crashes and my tabs are lost. How do I get the open tabs and backup the list to some…
stej
  • 28,745
  • 11
  • 71
  • 104
23
votes
1 answer

Owin Self host & ASP .Net MVC

I have an ASP .Net MVC app which works just fine under IIS. I need to be able to run the same app from a self hosted console app. How do I do that? Should I use OWIN? What the code should look like?
Igor Gatis
  • 4,648
  • 10
  • 43
  • 66
23
votes
5 answers

Handle CTRL+C on Win32

I have some problems with the handling of CTRL+C events, in a Win32 C++ console program. Basically my program looks like this: (based on this other question: Windows Ctrl-C - Cleaning up local stack objects in command line app) bool running; int…
eang
  • 1,615
  • 7
  • 21
  • 41
23
votes
2 answers

Changing font in a Console window in .NET

I have built a neat little Console app which basically interacts with ASP.NET projects on a users machine. I have a really trivial need, all I need to do is before I show the Console window, I need to have it a black background, a lime green…
theraneman
  • 1,620
  • 4
  • 18
  • 32
23
votes
1 answer

Download multiple files async and wait for all of them to finish before executing the rest of the code

I am trying to download multiple files from the internet and await for all of them to finish. This is a C# console application that I am running, so no progress bar event handler should be necessary. However it currently just continues to execute…
user2100493
  • 1,258
  • 4
  • 15
  • 26
22
votes
6 answers

.Net Console Application that Doesn't Bring up a Console

I have a console application I'm using to run scheduled jobs through windows scheduler. All the communication to/from the application is in email, event logging, database logs. Is there any way I can suppress the console window from coming up?
Jeff
  • 8,020
  • 34
  • 99
  • 157