console-application

Where is Task Scheduler console output? (C# console app)

半腔热情 提交于 2020-08-27 06:28:14
问题 I am running a C# windows console application and passing in a couple of arguments via Task Scheduler. It runs all day loading flat file data created by other applications into SQL server. The program fails intermittently and I have Try/Catch logic that writes information regarding the exception using Console.WriteLine(). So basically I need to track down the location of the console output so I can take steps to eliminate the intermittent failures. I've had a good look around online thinking

Getting font metrics without GUI (console mode)

血红的双手。 提交于 2020-08-27 04:19:37
问题 Let's say some images have to be generated by a Qt console program and that font metrics are needed by internal algorithms (they use the text width/height as input to compute the position where the drawing should occur). This program has to be runable on a Linux without any GUI (runlevel-3, basically a cluster without any display server). Problem: QFontMetrics are only available when running a Qt application in GUI mode. Any workaround to get string metrics without any display server ? 回答1:

Converting Console app to Windows Service

自作多情 提交于 2020-08-24 08:19:43
问题 Am trying to convert my console application, which generates pdf reports, into a windows service. My code is as follows. Am I on the right direction? I installed this service and start/stop works fine but no report is generated! The console app alone works fine to generate Output.pdf. My aim is to Generate ouput when the service starts. class Program : ServiceBase { public Program() { this.ServiceName = "My PdfGeneration"; } static void Main(string[] args) { ServiceBase.Run(new Program()); }

Error while trying to write inputs to running console app with a batch

谁说胖子不能爱 提交于 2020-08-20 12:09:17
问题 I have an exe file that I want to execute with a batch file. Exe file is a third party console app that will prompt for input three times. So I want to fill it in with an empty line, someText and someOtherText (echo. echo someText echo someOtherText) | call config.exe remove But I'm getting this error: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read. What could be the issue, please advise at least the direction to

Error while trying to write inputs to running console app with a batch

别等时光非礼了梦想. 提交于 2020-08-20 12:09:06
问题 I have an exe file that I want to execute with a batch file. Exe file is a third party console app that will prompt for input three times. So I want to fill it in with an empty line, someText and someOtherText (echo. echo someText echo someOtherText) | call config.exe remove But I'm getting this error: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read. What could be the issue, please advise at least the direction to

C# console get Windows 10 Accent Color

我的未来我决定 提交于 2020-07-30 03:38:05
问题 Is there a way in .Net Core 2.X to read the Selected Windows 10 Accent Color in a Console Application. Most of the solution i found are UWP or WPF apps. Too show you wich color I mean, here is a picture of it: 回答1: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ - Stores all decoration colors. So if app launched with rights to HKEY_CURRENT_USER you can read or change " AccentColor " property (and others in directory) or change the color code in hexadecimal notation on your own. To get

Getting the exit code of an application started with the “cmd” and “start” commands

Deadly 提交于 2020-07-05 06:46:49
问题 I have a console application. Interaction with this application is done via TCP/IP. I also have a test framework for it, which is basically a collection of BATCH scripts (...not my fault). What this test framework does for each test is basically this: start /min "myapplication.exe" and wait until verification is received that the application is up and running. send commands via TCP/IP to this application, receive its replies, and check if the timings and values agree with whatever is expected

Determine whether Console Application is run from command line or Powershell

不羁岁月 提交于 2020-06-25 06:37:49
问题 How do I determine whether a console application is being run from Powershell or the standard command line from within the application? 回答1: Something like this might be more reliable than checking the window title: using System; using System.Diagnostics; Process p = Process.GetCurrentProcess(); PerformanceCounter parent = new PerformanceCounter("Process", "Creating Process ID", p.ProcessName); int ppid = (int)parent.NextValue(); if (Process.GetProcessById(ppid).ProcessName == "powershell") {

C++ How do I hide a console window on startup?

时光总嘲笑我的痴心妄想 提交于 2020-06-24 05:06:07
问题 I want to know how to hide a console window when it starts. It's for a keylogger program, but it's not my intention to hack someone. It's for a little school project that I want to make to show the dangers about hackers. Here's my code so far: #include <cstdlib> #include <iostream> #include <Windows.h> using namespace std; int main() { cout << "Note. This program is only created to show the risk of being unaware of hackers." << endl; cout << "This program should never be used to actually hack