Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [windows-console]

Windows character mode applications using the functions provided by the console I/O functions. This tag should be used by questions about the console functions, structures and winevents, which support character mode applications.

2
votes
1answer
25 views

Go Unicode combining characters (grapheme clusters) and MS Windows Console cmd.exe

In the following code, the ü is not the single Unicode character U+00FC but is a single grapheme cluster composed of two Unicode characters, the plain ASCII u U+0075 followed by the combining ...
0
votes
0answers
31 views

How to fix UTF-8 issues with command execution

When I execute a command using backticks and print that output with puts it displays question marks instead of the right characters. This is my code (just a test to make it easier for you to read): # ...
1
vote
1answer
26 views

Combination of If and copy fails with syntax incorrect

I'm trying to create a .bat file that uses a Parameter to define which copy it should do. I tried the if without copy (an echo instead) which worked fine, and I tried the copy command which also ...
2
votes
2answers
57 views

Colored text output in PowerShell console using ANSI / VT100 codes

I wrote a program which prints a string, which contains ANSI escape sequences to make the text colored. But it doesn't work as expected in the default Windows 10 console, as you can see in the ...
2
votes
3answers
366 views

Why can't I redirect output from WriteConsole?

In the following program I print to the console using two different functions #include <windows.h> int main() { HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); DWORD byteswritten; ...
2
votes
2answers
11k views

How to IF check and do multiple things else in CMD

===== CMD BATCH FILE===== I am trying to check a variable=="string" then echo message and run program else it must quit exit 1 if anything else or even empty. I have tried so much already and used ...
0
votes
2answers
1k views

Command to copy current time and date to clipboard in Windows 7

In Windows 7 command prompt, I needed a command to copy current date and time to the clipboard. I used time /t & date /t | clip but it only copies the date and not the time. What should I do?
1
vote
1answer
38 views

Issue in opening new process window while Executing command in Cmd.Exe using C# Console App

I have a below code to execute series of commands in cmd.exe using .Net console. I have requirement to open new cmd window each time the command executes, so that it can be visualized. But below code ...
-1
votes
1answer
138 views

How to print sentence in the position of the mouse cursor in VC++ Win32 application?

I want to print something in the position where the mouse cursor is, so I use POINT cursorPos; GetCursorPos(&cursorPos); to get the position of mouse cursor. Then I set the console cursor to the ...
0
votes
0answers
37 views

Spawn child console/cmd.exe inside existing console/cmd.exe without a new window

I would like to spawn a console with different env variables (e.g. PATH or PROMPT) inside an already running console. I would also like to be able to "exit-back" to the original console via "exit" (...
3
votes
3answers
1k views

Displaying Unicode in Powershell

What I'm trying to achieve is rather straightforward though Powershell is making it almost impossible. I want to display the full path of files, some with Arabic, Chinese, Japanese and Russian ...
-5
votes
2answers
45 views

How to write ^C in the Windows console?

How to write ^C at in the Windows console? For example, I need to enter ^C in this window. If you press Ctrl+C in the console, the application exits and the console closes.
1
vote
1answer
43 views

Built in commands fail when used in for loop

I have a portion of a script that is intended to remove the ":" out of the time and "/" out of the date as returned by time /t and date /t commands. If I execute the command in a command prompt (cmd....
0
votes
0answers
32 views

How to exit C++ console using the exit button instead of using FreeConsole()?

Currently in my C++ application, I am using a Windows Console to print diagnostics messages. As of now, this window opens as if it were a toggle; when the toggle button is clicked: If the console ...
0
votes
0answers
31 views

Error on the cdm after running my python instabot

this is what I receive when I run the code (click here) As I am starting to get into python I have written this code to create an instabot, when I run it on the windows console, it seems like it is ...
33
votes
4answers
10k views

Console App Terminating Before async Call Completion

I'm currently writing a C# console app that generates a number of URLs that point to different images on a web site and then downloads as byte streams using WebClient.DownloadDataAsync(). My issue is ...
1
vote
1answer
24 views

Detecting -mconsole and -mwindows in compilation

Probably this is an easy or stupid question, but I cannot find the answer: Is it possible to check at compile time, if GCC on Windows is called with the -mwindows or the -mconsole option? I would like ...
0
votes
0answers
22 views

How do I send Ascii code to a printer port 9100 and get a reply

I have an industrial printer which is connected to a network and receives a trigger to print from another machine. To see when that triggers happens I will need some status information from the ...
1
vote
2answers
104 views

How to hide cmd.exe and cscript command prompts?

I have a test.cmd file on my desktop. In it contains the following line: cmd.exe /c "cscript foo.js" Is it possible to completely silence/quiet/supress/hide any and all console windows from popping ...
2
votes
3answers
465 views

Why ANSI Code-Page and Console Code-Page are different?

Microsoft Windows provides several functions to query current code-page: GetACP, GetConsoleOutputCP, GetConsoleCP. They return different values. For example, on my machine, GetACP returns 1252 ...
1
vote
1answer
30 views

installed program “cppcheck” but command “where cppcheck” (on windows command line) can't find anything

I downloaded and installed the program "cppcheck" (http://cppcheck.sourceforge.net/). This program has both a GUI (which I can access without problems) and a command line interface. However, when I ...
15
votes
3answers
17k views

Getting terminal size in c for windows?

How to check ymax and xmax in a console window, under Windows, using plain c? There is this piece of code for linux: #include <stdio.h> #include <sys/ioctl.h> int main (void) { ...
2
votes
0answers
68 views

Python stops working on Windows and console freezes

Firstly, I'm a pen tester, so I use Python & Perl all the time. I programmed a Python script for mass test exploiting of Wordpress to test all websites on a server. The script works perfectly on ...
1
vote
1answer
32 views

Jumbled output in CMD.EXE with a manually allocated console

I am getting frustrated. I have a Windows GUI application that manually opens a console. Calling AllocConsole and redirecting stdin, stdout, and stderr all work flawlessly. I can type any input and ...
4
votes
2answers
112 views

embed cmd in win32 application and text not selectable

I write both gui and console program. For console I use color output like \33[0m. For gui I need to write more code, if I switch to another gui library I need to rewrite the code. Some simple library(...
0
votes
0answers
63 views

Can't find App.config file for Windows Console app

I have a Windows console app that has an App.config file. The console app is to be executed from a SQL Agent job. In app.config I store a database connection. <connectionStrings> <add ...
214
votes
11answers
347k views
5
votes
4answers
9k views

Using STDIN with an AllocConsole()

I have a third-party dll that I load into software that isn't mine, and I'm using AllocConsole() to create the standard windows CLI window so I have an easy means of outputting debug messages. My ...
0
votes
0answers
29 views

SQL Server Management Studio - External Tools - Is it possible to have access current database or connection?

I need to develop a small C# console application which needs to have access to currently opened database connection in SQL Server Management Studio. I am thinking to add this tool in External Tools ...
65
votes
10answers
55k views

Output unicode strings in Windows console app

Hi I was trying to output unicode string to a console with iostreams and failed. I found this: Using unicode font in c++ console app and this snippet works. SetConsoleOutputCP(CP_UTF8); wchar_t s[]...
259
votes
16answers
325k views

How to use unicode characters in Windows command line?

We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š ...
-1
votes
1answer
31 views

Python 2 encoding in win 7 console

This question is related to Getting file path with umlauts from command line arguments under win7 using a batch file but has another twist. I installed win_unicode_console. I opened a console window ...
0
votes
0answers
25 views

Console window - programmatic command code (wParam of WM_COMMAND)

I find it very interesting when I can control a console window with my C#/C++ program. According to this post: Programmatically Paste Clipboard Text to a CMD Window (C# or C++), we can execute paste ...
213
votes
8answers
219k views

Assign output of a program to a variable

I need to assign the output of a program to a variable using a MS batch file. So in GNU Bash shell I would use VAR=$(application arg0 arg1). I need a similar behavior in Windows using a batch file. ...
1
vote
0answers
53 views

Hide phantomjs console

I am doing a project and I want him to be invisible. Therefore, i used this website - http://pytoexe.com/ to create an window based exe file from my python script which means it will not use the ...
0
votes
0answers
21 views

After converting my python script to windows based exe, phantomjs open a console window

I am doing a program and i want that it will be invisible to the user. Therefore, i converted my python script to window based exe file with this website - "http://pytoexe.com/" and now the script run ...
1
vote
1answer
37 views

Can you enter binary data in Windows command line?

Let's say that I am running a console application that takes input from the user. Is there a way to send binary data to the program, for example can I send the following three bytes to the program: ...
12
votes
7answers
63k views

Which font is used in MS-DOS?

Does anyone know which is the font that the Windows console/MS-DOS uses?
0
votes
1answer
37 views

Call RtlIsNameInExpression from .Net code

Because of a lot of intricacies in filename patternmatching in Windows (and former DOS) I'd like to call RtlIsNameInExpression from my .Net code to make sure my (console) application will behave ...
1
vote
2answers
698 views

Hide console window by an .exe file executed by a .py script

I am trying to hide a console window that pops up from an EXE file. I am running this EXE from my own EXE (a Python script frozen via PyInstaller). I found out that, whenever I run the script via ...
1
vote
1answer
23 views

Python: pip: how to change color of pip errormessages?

Using pip in a console window under windows 7 I can barely see the text of the errormessages. Is there any chance to tell pip to use another color? This dark red on top of black is a bad choice. ...
2
votes
2answers
492 views

Windows cmd which removes every bin and obj folders

I'm trying to write a windows script that will remove every bin and obj folder in my project folder. It just doesn't work.. I found this: for /d /r . %d in (_svn) do @if exist "%d" rd /s/q "%d" ...
0
votes
1answer
122 views

Windows console encoding

What is the default console encoding on Windows? It seems like sometimes it is the ANSI encoding (CP-1252), sometimes it is the OEM encoding (CP-850 for Western Europe by default) given by the chcp ...
3
votes
1answer
120 views

Keep .NET console application alive until the termination sequence finishes

I am working on a data acquisition application and I want to ensure that it exits gracefully. That is, it processes all the already collected data, flushes all the (file) buffers to "disk" (persistent ...
1
vote
0answers
33 views

Change text already displayed on the console

I have a question about changing text already displayed on the command line window. If I run the command timeout 10, the text already displayed on screen would keep on changing. How does this work? ...
8
votes
2answers
2k views

How to use the new support for ANSI escape sequences in the Windows 10 console?

The latest Windows 10 updates include support for ANSI escape sequences in conhost.exe. I have been able to confirm that the escape sequences are properly picked up in cmd.exe, so I have the ...
0
votes
1answer
81 views

Ruby's output in the Windows console VS mingw64 VS cygwin64

I'm having a really weird problem here. Here's simple code that uses puts: puts "Dale" sleep 1 puts "Cooper" I have 3 different terminals/consoles: Windows console (system default) mingw64 (UNIX-...
0
votes
2answers
45 views

Can you differentiate between raw numbers versus quoted numbers for command-line arguments without escaping the quotes in C#?

For a C# console app, if I provide the following, my parameters will be interpreted as the same value: myapp.exe "0" 0 And just be 0 with a length of 1 when inspected. I was wondering if there's a ...
3
votes
2answers
228 views

C# Nancy.Hosting.Self doesn't answer to requests from network, only to localhost request

I am trying to integrate nancy self hosting into my wpf project and when I start my program, I am able to connect to rest api from local browser, but cannot connect from another computer. ...
0
votes
1answer
127 views

How to read console input either space separated or newline separated in C#?

The input provided in my test is sometimes separated by and sometimes by \n. I want to store these inputs in an Array at the end. Sample Input: 1 2 3 4 5 (space separated) 1\n2\n3\n4\n5 (newline ...