1. If all of the following conditions are met, then quote characters
on the command line are
preserved:
- No /S switch (Strip quotes)
- Exactly two quote characters
- No
special
characters between the two quote characters, where
special
is one of:
& < >( )
@ ^ |
- There are one or more whitespace characters between the the two quote characters
- The string between the two quote characters is the name of an executable file.
2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the
leading character and remove the last quote character on the command line, preserving any text
after the last quote character. To negate this behaviour use a double set of quotes "" at the start
and end of the command line.
Full Screen
The key combination
ALT + ENTER
will switch a CMD window to full screen mode.
press
ALT + ENTER
again to return to a normal Window.
Opening CMD from Windows Explorer
You can open a new CMD
prompt by choosing START, RUN,
cmd
, OK
Copy and Paste / QuickEdit
To simplify the use of cut and paste at the Command Prompt, enable
QuickEdit
mode as
follows:
Activate the control menu at the top left of the current cmd window, go to Properties, Options tab
and then tick against QuickEdit Mode. Now you can select text with the mouse and hit Enter (or
right click) to copy it to the clipboard. Paste anywhere using Control+V (or Right Click) or via the
menu.
ESC will cancel any selection and return to editing mode.
When copying between windows, you may need one click to select the window and a second
click to paste.
Run multiple instances of CMD.exe
At the command line or in a batch script
CMD
will start a new instance of CMD.exe which will
appear in the same window. The EXIT command will close the second CMD instance and return
to the previous shell.
A method of calling one Batch script from another is
to run a command like
CMD /c
C:\docs\myscript.cmd
The output of CMD can be redirected into a text file. Notice that where CMD /c is used, the EXIT
command is not required.
The environment Variable %CMDCMDLINE% will expand into the original command line passed
to CMD.EXE
The native version of CMD.exe is always in
%windir%\system32
, on 64 bit operating systems
there is also a 32 bit CMD.exe in
%windir%\SysWOW64
Pausing or stopping a batch script
Execution of any batch script can be paused by pressing
CTRL-S
This also works for pausing a single command such as a
DIR
listing
Pressing any key will resume the operation.
Chia sẻ với bạn bè của bạn: