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
19
votes
3 answers

Multiple consoles for a single application C++

Is it possible to create two console windows (one being the main) and the secondary being a pop-up like a message box in Windows Forms? I only want the secondary console window to hold IDs (that will be hard coded into the application) So the user…
Tom C
  • 804
  • 2
  • 11
  • 24
19
votes
1 answer

AttachedToParent Task confusion

I have a problem understanding how AttachedToParent parameter works. Here is the sample code: public static void Main(string[] args) { Task parentTask = Task.Run(()=> { int[] results = new int[3]; …
19
votes
3 answers

Automate mouse click in windows with script/batch file

Firstly I'd like to point out that this is a rather strange question and also that I don't even know if stackoverflow is right for this... Anyways, is there a way to write a batch file or some other script that will automate a mouse click wherever…
user818700
19
votes
3 answers

Run PowerShell-Script from C# Application

I'm trying to execute a PowerShell script from a c# application. The script has to be executed under a special usercontext. I've tried different scenarios some are working some not: 1. direct call from PowerShell I've called the script directly from…
HW90
  • 1,953
  • 2
  • 21
  • 45
18
votes
5 answers

What is the best way to use Razor in a console application

I know similar questions have been asked before, but the only answers are six years old, and the projects people refer to seem like they're not being maintained. I want to use Razor in a console app or a class library to render HTML. I would also…
Brian Rak
  • 4,912
  • 6
  • 34
  • 44
18
votes
2 answers

.NET Core Global exception handler in console application

I'm porting an console application to .NET Core, and I'm trying to replace this line: AppDomain.CurrentDomain.UnhandledException += UnhandledException; After reading this, it seems there is no built-in way to do this. So my question: is the only…
Romain Vergnory
  • 1,496
  • 15
  • 30
18
votes
2 answers

How to create ZF3 console application

In Zend Framework 2 it's very simple to add the initial module banner to the console applications. All we need to is to implement the getConsoleBanner and getConsoleUsage methods and implement the…
kachar
  • 2,310
  • 30
  • 32
18
votes
2 answers

Load Assembly in New AppDomain without loading it in Parent AppDomain

I am attempting to load a dll into a console app and then unload it and delete the file completely. The problem I am having is that the act of loading the dll in its own AppDomain creates a reference in the Parent AppDomain thus not allowing me to…
Al Katawazi
  • 7,192
  • 6
  • 26
  • 39
18
votes
7 answers

How can I set up a configuration file for .NET console applications?

Is it possible to use a ".net configuration" file for a .NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use .NET's built in configuration…
mmattax
  • 27,172
  • 41
  • 116
  • 149
18
votes
2 answers

Publishing C# console application

I have developed a C# console application using VS2010. Now i would like to make it into a setup.exe. Is it possible to have this setup.exe as a standalone file to run my program? Meaning how can i achieve in obtaining setup.exe that when i click on…
10e5x
  • 909
  • 4
  • 15
  • 27
17
votes
2 answers

Start multiple console apps from a batch file

I'm trying to run some console application .exe files from a batch file in Windows. However, when I run the following code it only starts the first of the apps: "C:\Development\App\bin\Debug1\Application.exe" timeout…
finoutlook
  • 2,523
  • 5
  • 29
  • 43
17
votes
1 answer

Logging in console application (.NET Core with DI)

guys. I try to add logging to my console app with DI (.NET Core 3.1) and seems that IoC container works fine for that, injects logger dependency to my classes, but LogXXX method doesn't log to output. What can be the reason? Maybe there are some…
Ivan Khorin
  • 827
  • 1
  • 5
  • 17
17
votes
7 answers

C# arrow key input for a console app

I have a simple console app written in C#. I want to be able to detect arrow key presses, so I can allow the user to steer. How do I detect keydown/keyup events with a console app? All my googling has led to info about windows Forms. I don't have…
Tim
  • 8,912
  • 3
  • 39
  • 57
17
votes
2 answers

.NET Application will run as a Console Application but not as Windows Forms, Debug Works

I have a Windows Application that worked once before on .NET 2.0, and I just wanted to bring it forward to .NET Framework 4. I've done this hundreds of times before without issue. Long Story Short: After upgrading, I can run the Windows Application…
Matt
  • 247
  • 1
  • 10
17
votes
4 answers

Is there a way to make a console window flash in the task bar programmatically

Basically I made console app that performs some task that takes a few minutes. I'd like to have it flash in the taskbar to let me know when it's done doing its thing.
Davy8
  • 30,868
  • 25
  • 115
  • 173