Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to input special character in cmd?

Tags:

shell

cmd

I have written a c program that retrieves arguments from the command line under Windows. One of the arguments is a regular expression. So I need to retrieve special characters such as "( , .", etc., but cmd.exe treats "(" as a special character.

How could I input these special character?

thanks.

like image 832
Jichao Avatar asked Nov 16 '09 11:11

Jichao


People also ask

What is %% A in CMD?

Use a single percent sign ( % ) to carry out the for command at the command prompt. Use double percent signs ( %% ) to carry out the for command within a batch file. Variables are case sensitive, and they must be represented with an alphabetical value such as %a, %b, or %c. ( <set> ) Required.

How do you type special characters?

To type special characters in Windows, hold the Alt key, type the number code associated with the special character you want using the numpad that's located on the right side of your keyboard. The row of numbers above your letter keys won't work.

How do I change my appearance in CMD?

If you don't like the default CMD window position or the screen buffer size, you can change it from the Layout tab. In the CMD Properties window, open the Layout tab. In the Screen Buffer Size section, change the value to specify how much content you can view. Leave it as default if you are unsure of what it does.


1 Answers

You can generally prefix any character with ^ to turn off its special nature. For example:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Pax>echo No ^<redirection^> here and can also do ^
More? multi-line, ^(parentheses^) and ^^ itself
No <redirection> here and can also do multi-line, (parentheses) and ^ itself

C:\Documents and Settings\Pax>

That's a caret followed by an ENTER after the word do.

like image 68
paxdiablo Avatar answered Jan 01 '23 23:01

paxdiablo