Windows Activation Key Command Prompt

0 views
Skip to first unread message

Heinz Francis

unread,
Aug 3, 2024, 3:14:31 PM8/3/24
to swareradag

I want to be able to scroll up further to see the result of a command. For example, if I type dir in a directory with a lot of listings, like C:\windows, the output will be very long. When I try to scroll up, I'll probably go from z to s and never get to the r's. Too many files/directories in the folder.

Or you may consider command-line alternatives under Windows (I've never understood how the cmd.exe hadn't been rewritten by Microsoft in order to have something with less limitations and more ease of use).

I'm adding this question after spending an entire day wrestling with this incredibly frustrating feature of the Windows 10 command prompt which made me think there was something wrong with my console application code. I hope it will help someone.

The issue ended up being a new feature of the windows 10 console. Under the default config, whenever you click on a command window in windows 10, it immediately halts the application process when it attempts to write to the console. When this happens, the command window has gone into "selection" mode.

What I'd like to add here to Shaun Rowan's answer is that for it to work in all console windows you have to click "Defaults", instead of "Properties" and make your changes there, as described in this post.

I faced this problem very recently where one of the users (who had Quickedit configured on his Command Prompt) was using a tool I developed in Java, and was getting the tool frozen while running it from command prompt.

It's possible to disable the annoying QuickEdit Mode programmatically by importing Windows' Kernel32.dll library and using the console API functions GetStdHandle, GetConsoleMode, and SetConsoleMode through your language's native interface (e.g., Java's JNI, Python ctypes).

I must point out that the application is actually not "halted" or "paused", it's only because the console output stream is blocked whenever you click on the command window, and if you see the whole application pausing, it's because these programs don't implement multithreading and non-blocking IO correctly.

You can easily verify this by writing a multi-threading application. For example, the following Java application shows a login dialog and continues to output text on the console. When the console blocks, you can still interact with the GUI.

You should always avoid calling print() or similar methods directly; if the console responds slowly, your program will be slowed down as a result. Create a thread to perform the print() task, or use a non-blocking alternative.

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Hi all,I am using Windows 10 I type telnet httpbin.org 80 into command prompt and it connects. New window opens and then I type in GET /xml HTTP/1.1 , Host: httpbin.org , but as I am typing I can not see what I am typing. I get the results but , as I am typing I can not see what I am typing. If somebody could help.

This command will cause the text you type to appear in the upper left corner of the screen (over top of text already in the console window - makes the text difficult to read...). Once you get to this stage type the commands as shown in the video:

Solution #1: open command promt as admin (right click on the icon -> launch as admin). It will work and connection won't be lost. After that every other session will work too, so you don't have to launch it as admin everytime.Solution #2: just type "telnet httpbin.org 80". It won't display what you type but connection will be stable.

When I use the iPad to connect to a Windows system and open a command prompt, the key sent for a quote ( " ) is not the same as a Windows quote. It looks different and Windows does not recognize this as a quote. There is no way to type a proper quote using the iPad. I either need to use the on-screen keyboard, or start to type a directory name that has a space and hit the tab key. Windows will automatically complete the path and include the proper quotes. That quote character can then be copied to the clipboard and pasted where necessary.

This is also a similar issue using ctrl and shift keys when remoting to a Windows virtual host and trying to use those keys while connected to a virtual machine. The normal shif key does not work, but the shift key at the very top, that looks like an up arrow does.

Using iOS 11, a punctuation character appears to be sent incorrectly. This could be the result of "smart punctuation" which is an iOS 11 feature that is enabled by default. You can turn this off Settings > General > Keyboards.

Using find /c /v and try finding something that is never included in a file name, such as ::. Won't. Work. Reliably. When the console window is set to raster fonts then you can get those character combination. I can include characters in a file name such as :, ?, etc. in their full-width variants for example, which will then get converted to their normal ASCII counterparts which will break this. If you need an accurate count, then don't try this.

which will first output all file names, one line each. And then count all lines of that output which are not empty. Since the file name can't be empty (unless I'm missing something, but Unicode will not trip this up according to my tests).

A word of warning about using PowerShell for simple file operations like this - it is incredibly slow compared to cmd.exe, especially over network connections or when there are thousands of files in the directory. See this forum post for more info.

Just a caveat for those who might use Trevoke's PowerShell answer above (Windows command prompt: how to get the count of all files in current directory?): by design, echoing the Count property of a collection returned by Get-ChildItem can give misleading results if the value is 1 or 0. This is because the Count property is only available on arrays. If fewer than 2 items are returned by Get-ChildItem, the result is scalar, and .Count returns nothing. To get around this, explicitly cast it into an array, e.g., @(Get-ChildItem C:\Scripts).Count.

If I only needed this once I'd just use dir, otherwise I'd consider rolling my own, probably as a C# app because that's what I would be most familiar with (although VBScript or PowerShell would also be viable).

in order to get the file count of a particular directory. Remove the "/D" option if you don't want to count folders. The "/s" option processes files in all directories in the specified path. So remove it if you only want files in the specified path and don't want to include files in sub folders.

A lot of Windows users have never touched the Command Prompt. With today's streamlined operating systems, it's easy to use a computer without ever worrying about entering old-school text commands in the command line.

However, it's a good idea to become familiar with command line basics in Windows. It helps you appreciate the OS more and can come in handy for some tasks. Here's a beginner's guide to the Windows Command Prompt for those who aren't yet familiar.

The Command Prompt, officially called the Windows Command Processor and often abbreviated to CMD, is the command line interface for Windows operating systems. A command line interface is a way of interacting with a computer directly using text commands.

These hearken back to the early days of computers, when you had to type commands into a terminal to execute processes on the machine. Early PC operating systems, like MS-DOS, operated exclusively through command-line interfaces. There were no mouse cursor, window management, or similar graphical user interface (GUI) elements we take for granted today.

Another term you should know is the word "shell," which is used to describe a program that allows the user to give commands to the computer. So a command line interface, as well as a GUI, are both shells.

Early versions of Windows, like Windows 3.1, effectively ran as a visual interface on top of DOS. Later versions, including Windows 95 through Windows ME, also included MS-DOS integration. These allowed you to run commands through the MS-DOS Prompt, as the Command Prompt was called at the time.

Starting with Windows XP, Windows broke away from MS-DOS. However, in modern versions of Windows, you can still use the Command Prompt to interface with your computer directly instead of clicking through various menus. The Command Prompt can also run batch files; these make automating tasks easy.

To run the Command Prompt as an admin, hold Ctrl + Shift when you launch either of the first two options above. If you use the third option, pick Command Prompt (Admin) (or the corresponding option that appears for you) instead. This will require you to accept a UAC prompt, so you'll need to be logged into an admin account or provide an admin password.

This is your current location. Any commands you run that rely on location (such as deleting files) will take place in this folder. Other CMD commands are more general and don't rely on you being in a specific location.

It's important to know that when working in the Command Prompt, you must type commands exactly as the system expects. Since you're issuing commands directly to your computer, it won't understand if you type something wrong.

This isn't a problem; what's more of a risk is accidentally typing the wrong command, or using a command in a way you didn't intend. For example, when trying to delete one file, you might accidentally tell it to delete an entire folder instead.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages