Trong nội dung bài viết này

This article discusses the limitation to lớn the length of the strings that you use from the command prompt in Command Prompt (Cmd.exe). It also provides methods that you can use to work around this limitation.

Bạn đang xem: Mac keyboard shortcuts

Applies to: Windows vps 2012 R2, Windows vps 2008 R2 Service Pack 1, Windows 7 Service Pack 1Original KB number: 830473

More information

The maximum length of the string that you can use at the command prompt is 8191 characters.

This limitation applies to:

the command lineindividual environment variables that are inherited by other processes, such as the PATH variableall environment variable expansions

If you use Command Prompt lớn run batch files, this limitation also applies lớn batch tệp tin processing.

Examples

The following examples show how this limitation applies khổng lồ commands that you run in Command Prompt, & commands that you use in a batch file.

In Command Prompt, the total length of the following command line can"t contain more than 8191 characters:

cmd.exe /k Executable
File.exe parameter1, parameter2... Parameter
NIn a batch file, the total length of the following command line can"t contain more than 8191 characters:

cmd.exe /k Executable
File.exe parameter1, parameter2... Parameter
NThis limitation applies to command lines that are contained in batch files when you use Command Prompt khổng lồ run the batch file.

In Command Prompt, the total length of Environment
Variable1 after you expand Environment
Variable2 và Environment
Variable3 can"t contain more than 8191 characters:

c:> phối Environment
Variable1 = Environment
Variable2 Environment
Variable3In a batch file, the total length of the following command line after you expand the parameters can"t contain more than 8191 characters:

Executable
File.exe parameter1 parameter2

How to work around the limitation

To work around the limitation, use one or more of the following methods, as appropriate lớn your situation:

Modify programs that require long command lines so that they use a file that contains the parameter information, and then include the name of the tệp tin in the command line.

For example, instead of using the Executable
File.exe Parameter1 Parameter2... Parameter
N command line in a batch file, modify the program lớn use a command line that is similar lớn the following command line, where Parameter
File
is a tệp tin that contains the required parameters (parameter1 parameter2... Parameter
N):

Executable
File.exe c: empParameter
File.txt
Modify programs that use large environment variables so that the environment variables contain less than 8191 characters.

For example, if the PATH environment variable contains more than 8191 characters, use one or more of the following methods khổng lồ reduce the number of characters:

Use shorter names for folders & files.Reduce the depth of thư mục trees.Store files in fewer folders so that fewer folders are required in the PATH environment variable.Investigate possible methods that you can use to reduce the dependency of PATH for locating .dll files.

By pressing certain key combinations, you can bởi vì things that normally need a mouse, trackpad, or other đầu vào device.


To use a keyboard shortcut,press & hold one or more modifier keys và then press the last key of the shortcut. For example, khổng lồ use Command-C (copy), press & hold the Command key, then the C key, then release both keys. Mac menus và keyboards often use symbols for certain keys, including modifier keys:


Caps Lock ⇪Fn
*

On keyboards made for Windows PCs, use the alternative text key instead of Option, and the Windows logo key instead of Command.Some keys on some táo bị cắn keyboards have special symbols and functions, such as for display brightness

*
, keyboard brightness
*
,and more. If these functions aren"t available on your keyboard, you might be able to lớn reproduce some of them bycreating your own keyboard shortcuts.To use these keys as F1, F2, F3, or other standard function keys, combine them with the Fn key.




You might need lớn press và hold some of these shortcuts for slightly longer than other shortcuts. This helps you lớn avoid using them unintentionally.

Power button:Press lớn turn on your Mac or wake it from sleep.Press và hold for 1.5 seconds to put your Mac khổng lồ sleep.* Continue holding toforce your Mac to lớn turn off.Option–Command–Power button* orOption–Command–Media Eject: Put your Mac lớn sleep.Control–Shift–Power button*orControl–Shift–Media Eject:Put your displays khổng lồ sleep.Control–Powerbutton*orControl–Media Eject:Display a dialog asking whether you want lớn restart, sleep, or shut down.Control–Command–Powerbutton:* Force your Mac to restart, without prompting to lớn save any xuất hiện and unsaved documents.Control–Command–Media Eject:Quit all apps, then restart your Mac. If any mở cửa documents have unsaved changes, you will be asked whether you want lớn save them.Control–Option–Command–Powerbutton*orControl–Option–Command–Media Eject:Quit all apps, then shut down your Mac. If any xuất hiện documents have unsaved changes, you will be asked whether you want to lớn save them.Control-Command-Q: Immediately lock your screen.Shift-Command-Q:Log out of your mac
OS user account. You will be asked to confirm. Lớn log out immediately without confirming, press
Option-Shift-Command-Q.

Xem thêm: Những Cách Kiếm Bạc Trong Kiếm Thế Nào Để Có Bạc Trong Kiếm Thế

* Does not apply to the
Touch ID sensor.