windows-console

Windows XP batch file concat

旧城冷巷雨未停 提交于 2019-11-30 16:57:51
I'm trying to accomplish the following ridiculous task: I have a text file containing a set of fully qualified filesnames. I want to iterate through the file and append each line to a common variable, that can be passed to a command line tool. For example, the file might be: C:\dir\test.txt C:\WINDOWS\test2.txt C:\text3.txt and I'd like to assign them to some variable 'a' such that: a = "C:\dir\test.txt C:\WINDOWS\test2.txt C:\text2.txt" A secondary question is - what is a good batch file reference? I'm finding some stuff in the Windows material, and a lot of home-grown websites, but nothing

Color console output with C++ in Windows

梦想与她 提交于 2019-11-30 12:57:02
问题 Is there a way to output colored text to the console? I am using Visual Studio 2010, and only need the code to work in Windows. I have been unsuccessful in finding anything except the windows COLOR command, but that changed the color for the entire screen, and I am looking for something that will change only the part I wish to output. I've seen it done in Managed C++ E.g., {color red} cout << "Hello "; {color blue} cout << "world\n"; would yield "Hello world" in red and blue. 回答1: I took this

Colorize stdout output to Windows cmd.exe from console C++ app

女生的网名这么多〃 提交于 2019-11-30 09:02:28
问题 I would like to write something similar to cout << "this text is not colorized\n"; setForeground(Color::Red); cout << "this text shows as red\n"; setForeground(Color::Blue); cout << "this text shows as blue\n"; for a C++ console program running under Windows 7. I have read that global foreground & background can be changed from cmd.exe's settings, or by calling system() - but is there any way to change things at character-level that can be coded into a program? At first I thought "ANSI

How to start 2 programs simultaneously in windows command prompt

孤者浪人 提交于 2019-11-30 06:55:47
问题 I am using Windows 7 64bit Here is the code snippet I am using to start @echo off call "C:\Program Files (x86)\LOLReplay\LOLRecorder.exe" call "G:\League of Legends\lol.launcher.exe" exit But unless I close LOLRecorder.exe it won't start my lol.launcher.exe.... basically I want both running and the cmd prompt exit after they start. Whats wrong here? I checked out another stackoverflow answer Here but it refers to the same method I am using. EDIT: With the start command it just starts 2

Multiple consoles for a single application C++

℡╲_俬逩灬. 提交于 2019-11-30 02:24:08
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 does not have to keep returning to the main menu to check available IDs If so how would you go about it? Many Thanks Yes, you can do it. The solution is actually very simple - our process can start a new helper child-process, so the helper process will display whatever our process sends it. We can easily implement such a solution with pipes: for each

Windows XP batch file concat

我怕爱的太早我们不能终老 提交于 2019-11-29 23:47:22
问题 I'm trying to accomplish the following ridiculous task: I have a text file containing a set of fully qualified filesnames. I want to iterate through the file and append each line to a common variable, that can be passed to a command line tool. For example, the file might be: C:\dir\test.txt C:\WINDOWS\test2.txt C:\text3.txt and I'd like to assign them to some variable 'a' such that: a = "C:\dir\test.txt C:\WINDOWS\test2.txt C:\text2.txt" A secondary question is - what is a good batch file

Is there a limit on the output of Console Window?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 15:29:04
Code: This program checks if the 2 numbers entered and their sum are divisible by the numbers 2 - 9, and displays the remaining divisible numbers (excluding the one being reviewed). static void Main(string[] args) { for (int i = 2; i < 10; i++) { Challenge(2, 6, i); } Console.ReadLine(); } static void Challenge(int num1, int num2, int Divisor) { int sum = num1 + num2; bool SumDivisible = sum % Divisor == 0; bool num1Divisible = num1 % Divisor == 0; bool num2Divisible = num2 % Divisor == 0; int highNum = 80; List<int> NumbersDivisible = Enumerable.Range(1, highNum).Where(x => x % Divisor == 0)

Windows console application - signal for closing event

て烟熏妆下的殇ゞ 提交于 2019-11-29 11:54:49
In windows console application, one can catch pressing ctrl+c by using: #include <stdio.h> #include <signal.h> void SigInt_Handler(int n_signal) { printf("interrupted\n"); } int main(int n_arg_num, const char **p_arg_list) { signal(SIGINT, &SigInt_Handler); getchar(); // wait for user intervention } This works well, except it does not work at all if the user presses the cross × that closes the console window. Is there any signal for that? The reason I need this is I have this CUDA application which tends to crash the computer if closed while computing something. The code is kind of

Colorize stdout output to Windows cmd.exe from console C++ app

半腔热情 提交于 2019-11-29 11:08:28
I would like to write something similar to cout << "this text is not colorized\n"; setForeground(Color::Red); cout << "this text shows as red\n"; setForeground(Color::Blue); cout << "this text shows as blue\n"; for a C++ console program running under Windows 7. I have read that global foreground & background can be changed from cmd.exe's settings, or by calling system() - but is there any way to change things at character-level that can be coded into a program? At first I thought "ANSI sequences", but they seem to be long lost in the Windows arena. You can use SetConsoleTextAttribute function:

How to start 2 programs simultaneously in windows command prompt

﹥>﹥吖頭↗ 提交于 2019-11-28 23:24:41
I am using Windows 7 64bit Here is the code snippet I am using to start @echo off call "C:\Program Files (x86)\LOLReplay\LOLRecorder.exe" call "G:\League of Legends\lol.launcher.exe" exit But unless I close LOLRecorder.exe it won't start my lol.launcher.exe.... basically I want both running and the cmd prompt exit after they start. Whats wrong here? I checked out another stackoverflow answer Here but it refers to the same method I am using. EDIT: With the start command it just starts 2 terminal windows and nothing starts! @echo off start "C:\Program Files (x86)\LOLReplay\LOLRecorder.exe" start