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.

614 questions
11
votes
1 answer

Restore default working dir if bat file is terminated abruptly

I have a scenario where during execution of a batch file, it navigates to a different folder (say to "../asdf"); and at the end of execution it will set the current working dir as the same folder from where the user called the .bat file. But if the…
human
  • 168
  • 1
  • 10
10
votes
6 answers

What to do with "The input line is too long" error message?

I am trying to use os.system() to call another program that takes an input and an output file. The command I use is ~250 characters due to the long folder names. When I try to call the command, I'm getting an error: The input line is too long. I'm…
Tony Trozzo
  • 1,231
  • 6
  • 20
  • 34
10
votes
2 answers

How to change the Console Ouptut Mode using SetConsoleMode in powershell?

I am trying to change the Windows Console Mode for output (CONOUT$) using the Windows API and SetConsoleMode calls. So I modified a PowerShell script, based on ConinMode.ps1 (and which works for input), to do this. Reading works fine with both the…
not2qubit
  • 14,531
  • 8
  • 95
  • 135
10
votes
1 answer

Running my C++ code gives me a blank console

I'm trying to run some C++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore. Also if I run it in debug mode Visual Studio…
MatijaxD
  • 171
  • 2
  • 8
10
votes
4 answers

How to hide console cursor in c?

I have a simple C program that represents a loading screen within the console, but I can't get the cursor to hide. I tried cranking up the speed of the sleep function so that the cursor timer would be reset and the cursor would be gone but that…
BRHSM
  • 854
  • 3
  • 13
  • 48
9
votes
5 answers

How can i add a console output to a windows wpf application C#

i would like to add an additional console window to log realtine info from my wpf application. Any idea?? Bayo answer: console application in the project properties works for me. thank's
Bayo Alen
  • 341
  • 1
  • 6
  • 13
8
votes
1 answer

How to send POST request with json body via curl from windows batch script

I'm writing batch script which should send request with json. call curl -X POST -H 'Content-type: application/json' --data '{"text": "Pull requests:\n%linksText% has been deployed to %stagingServerUrl%", "username": "Staging Server"}'…
dKab
  • 2,658
  • 5
  • 20
  • 35
8
votes
2 answers

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" so I've tried: for /d /r . %d in (bin) do @if exist…
Ish Thomas
  • 2,270
  • 2
  • 27
  • 57
8
votes
1 answer

Application.exe is not a valid Win32 application error

I have written a Console application that client is trying to run it on their Windows Server 2003 R2 machine machine and they get that error message. If I go to Build -> Configuration Manager all my projects are set to Platform of "Any CPU" and…
8
votes
1 answer

What is this \u001b[9... syntax of choosing what color text appears on console, and how can I add more colors?

I was messing around with debug and colors.js to get more colors than the limited 4-6 colors but I'm stuck at figuring out this coloring syntax args[0] = ' \u001b[9' + c + 'm' + name + ' ' + '\u001b[3' + c + 'm\u001b[90m' + args[0] + '\u001b[3'…
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
7
votes
4 answers

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 problem is though, is that it ignores any kind of…
Nowayz
  • 1,882
  • 4
  • 21
  • 34
7
votes
2 answers

How to set an environment variable dependent on another one? (Windows)

I am looking for a way on Windows how to set an environment variable dependent on another one. In my case, I want to add the new path to PYTHONPATH. Let's say, that there is an existing environment variable %INSTALLATION_DIR% =…
golden96371
  • 350
  • 6
  • 19
7
votes
2 answers

How to execute Windows CLI commands in Ruby?

I have a file located in the directory "C:\Documents and Settings\test.exe" but when I write the command `C:\Documents and Settings\test.exe in single qoutes(which I am not able to display in this box), used for executing the commands in Ruby, I am…
Apoorv Saxena
  • 4,086
  • 10
  • 30
  • 46
7
votes
2 answers

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. My workaround currently is to copy the text into…
thopy
  • 77
  • 1
  • 8
7
votes
3 answers

How can I measure the window height (number of lines) in powershell?

The maximum number of lines in my environment is 47. Can I measure this value programmatically?
Hyundong Hwang
  • 711
  • 1
  • 8
  • 19
1 2
3
40 41