命令提示符(Command Prompt)和PowerShell是(PowerShell)Windows PC(Windows PCs)上命令行用户的两个基本工具。如果您经常访问这些工具,您可以将命令提示符(Command Prompt)和PowerShell快捷方式添加到您的桌面以快速访问它们。
您甚至可以为这些应用程序分配键盘快捷键。(keyboard shortcut)
在 Windows 10 上创建命令提示符桌面快捷方式(Create a Command Prompt Desktop Shortcut on Windows 10)
您可以像添加任何其他快捷方式一样将命令提示符(Command Prompt)快捷方式添加到桌面。添加快捷方式后,您可以根据自己的喜好更改其名称和图标。(change its name and icon)
开始:
- 打开开始(Start)菜单并搜索命令提示符(Command Prompt)。
- 在搜索结果中右键单击命令提示符并选择(Command Prompt)打开文件位置(Open file location)。
- 文件资源管理器(File Explorer)窗口将打开,其中包含命令提示符(Command Prompt)快捷方式。在这里,再次右键单击命令提示符(Command Prompt)快捷方式,然后选择打开文件位置(Open file location)。
- 您现在应该看到一个名为cmd.exe的文件,它是命令提示符(Command Prompt)可执行文件。右键单击cmd.exe文件并选择发送到(Send to)>桌面(创建快捷方式)(Desktop (create shortcut))。
- 访问您的桌面,您应该会在此处找到一个名为cmd.exe 的新快捷方式 - 快捷方式(cmd.exe – Shortcut)。双击(Double-click)此快捷方式打开命令提示符(Command Prompt)。
- 要重命名快捷方式,请右键单击快捷方式,选择Rename,输入新名称,然后按Enter。
使用管理员权限运行命令提示符快捷方式(Run the Command Prompt Shortcut With Admin Rights)
要运行某些命令,您需要在Command Prompt中拥有管理员权限。您可以配置桌面命令提示符(Command Prompt)快捷方式,使其始终以管理员权限打开该工具。
去做这个:
- 右键单击桌面上的命令提示符(Command Prompt)快捷方式,然后选择Properties。
- 在“属性(Properties)”窗口中,选择顶部的“快捷方式”选项卡。(Shortcut)
- 在快捷方式(Shortcut)选项卡中,选择显示为Advanced的按钮。
- 屏幕上会打开一个新窗口。在这里,启用以管理员身份运行(Run as administrator)复选框并选择底部的确定。(OK)
- 返回“属性(Properties)”窗口,选择“应用(Apply)” ,然后选择底部的“确定”。(OK)
- 双击命令提示符(Command Prompt)快捷方式,它现在应该以管理员权限打开。
创建键盘快捷键以启动命令提示符(Create a Keyboard Shortcut to Launch Command Prompt)
通过为工具的桌面快捷方式分配键盘快捷方式(assigning a keyboard shortcut),您可以更轻松地打开命令提示符。(Command Prompt)Windows 允许您为快捷方式选择自定义组合键。
要分配快捷方式:
- 右键单击桌面上的命令提示符(Command Prompt)快捷方式,然后选择Properties。
- 选择属性(Properties)窗口顶部的快捷方式选项卡。(Shortcut)
- 在快捷键(Shortcut)选项卡中,选择快捷键(Shortcut key)字段。知道(Know)您在此处分配的任何键盘快捷键,Windows都会为其添加前缀Ctrl + Alt。
- 按(Press)要分配给命令提示符(Command Prompt)快捷方式的键。例如,按C。快捷键(Shortcut key)字段应显示Ctrl + Alt + C。
- 然后,选择应用(Apply),然后选择底部的确定(OK)以保存更改。
将命令提示符快捷方式添加到 Windows 任务栏(Add the Command Prompt Shortcut to the Windows Taskbar)
您可能希望将命令提示符(Command Prompt)固定到任务栏(your taskbar),以通过单击打开该工具:
- 右键单击桌面上的命令提示符(Command Prompt)快捷方式,然后选择固定到任务栏(Pin to taskbar)。
- 该工具现在位于您的任务栏上。
- 要删除此任务栏快捷方式,请右键单击快捷方式并选择Unpin from taskbar。
在 Windows 10 上创建 PowerShell 桌面快捷方式(Create a PowerShell Desktop Shortcut on Windows 10)
如果您使用 PowerShell(use PowerShell),将 PowerShell 的快捷方式添加到您的桌面就像添加任何其他应用程序的快捷方式一样简单。
- 启动开始(Start)菜单并搜索Windows PowerShell。
- 在搜索结果中右键单击Windows PowerShell ,然后选择(Windows PowerShell)打开文件位置(Open file location)。
- 在以下屏幕上,右键单击Windows PowerShell并选择Open file location。
- 您现在应该看到powershell.exe。右键单击此文件并选择发送到(Send to)>桌面(创建快捷方式)(Desktop (create shortcut))。
- 现在,您的 Windows 桌面上有一个PowerShell快捷方式。(PowerShell)
使用管理员权限运行 PowerShell 快捷方式(Run the PowerShell Shortcut With Admin Rights)
如果您运行需要管理员权限的命令,请将PowerShell快捷方式配置为始终以管理员权限打开该工具。
- 右键单击桌面上的PowerShell快捷方式,然后选择Properties。
- 在属性(Properties)中选择快捷方式(Shortcut)选项卡。
- 在快捷方式(Shortcut)选项卡中选择高级(Advanced)按钮。
- 在打开的“高级属性(Advanced Properties)”窗口中,激活“以管理员身份运行”(Run as administrator)框,然后选择底部的“确定”。(OK)
- 选择应用(Apply),然后选择窗口底部的确定。(OK)
- 您的PowerShell快捷方式现在将始终以管理员权限打开。
创建用于启动 PowerShell 的键盘快捷方式(Create a Keyboard Shortcut to Launch PowerShell)
您可以为PowerShell桌面分配快捷方式,以便通过击键打开该工具。
- 右键单击桌面上的PowerShell快捷方式,然后选择Properties。
- 在属性(Properties)中选择快捷方式(Shortcut)选项卡。
- 选择快捷键(Shortcut key)字段并键入要使用的键盘快捷键。请记住,您的快捷方式将以Ctrl + Alt为前缀。
- 例如,如果您指定P,Windows 会将其视为Ctrl + Alt + P。
- 选择应用(Apply),然后选择底部的确定以保存您的快捷方式。(OK)
将 PowerShell 快捷方式添加到 Windows 任务栏(Add the PowerShell Shortcut to the Windows Taskbar)
为了快速访问,您可以将PowerShell 快捷方式添加到任务栏(shortcut to your taskbar)。
- 右键单击桌面上的PowerShell快捷方式,然后选择Pin to taskbar。
- PowerShell图标现已添加到您的任务栏。
- 要删除此快捷方式,请右键单击任务栏上的快捷方式,然后选择Unpin from taskbar。
额外提示:使用键盘快捷方式打开命令提示符或 PowerShell 的任务栏快捷方式(Bonus Tip: Open Command Prompt or PowerShell’s Taskbar Shortcut With a Keyboard Shortcut)
默认情况下,Windows 10 会为任务栏上的每个应用程序分配一个键盘快捷键。这些快捷方式使用数字系统。在这里,任务栏最左侧的应用程序编号为 1,然后是 2、3,依此类推。
要使用此快捷方式,您需要按Windows键,然后按任务栏上的应用程序编号。例如,如果命令提示符(Command Prompt)是任务栏上第五个编号的快捷方式,您将使用Windows + 5打开该实用程序。
您可以向任意方向(向左或向右)拖动任务栏上的图标,它们的快捷方式将相应更改。
How to Set Up Command Prompt and PowerShell Keyboard/Desktop Shortcuts
Сommand Prompt and PowerЅhell are two essential tools for a command-line user on Windows PCs. If you accesѕ these tools frеquently, you can add the Command Prompt and PowerShell ѕhortcuts to your desktop to quickly access them.
You can even assign a keyboard shortcut to these apps.
Create a Command Prompt Desktop Shortcut on Windows 10
You can add a Command Prompt shortcut to your desktop the same way you add any other shortcut. Once the shortcut is added, you can change its name and icon to your liking.
To start:
- Open the Start menu and search for Command Prompt.
- Right-click Command Prompt in the search results and select Open file location.
- A File Explorer window opens with a Command Prompt shortcut. Here, right-click the Command Prompt shortcut again and select Open file location.
- You should now see a file called cmd.exe, which is the Command Prompt executable file. Right-click the cmd.exe file and select Send to > Desktop (create shortcut).
- Access your desktop, and you should find a new shortcut called cmd.exe – Shortcut there. Double-click this shortcut to open Command Prompt.
- To rename the shortcut, right-click the shortcut, select Rename, enter a new name, and press Enter.
Run the Command Prompt Shortcut With Admin Rights
To run certain commands, you’d need admin privileges in Command Prompt. You can configure your desktop Command Prompt shortcut so that it always opens the tool with admin privileges.
To do this:
- Right-click the Command Prompt shortcut on your desktop and select Properties.
- On the Properties window, select the Shortcut tab at the top.
- In the Shortcut tab, select the button that says Advanced.
- A new window opens on your screen. Here, enable the Run as administrator checkbox and select OK at the bottom.
- Go back to the Properties window, select Apply and then select OK at the bottom.
- Double-click the Command Prompt shortcut, and it should now open with admin privileges.
Create a Keyboard Shortcut to Launch Command Prompt
You can make opening Command Prompt even easier by assigning a keyboard shortcut to the tool’s desktop shortcut. Windows allows you to choose a custom combination of keys for the shortcut.
To assign a shortcut:
- Right-click the Command Prompt shortcut on your desktop and select Properties.
- Select the Shortcut tab at the top of the Properties window.
- In the Shortcut tab, select the Shortcut key field. Know that whatever keyboard shortcut you assign here, Windows will prefix it with Ctrl + Alt.
- Press the key that you want to assign to the Command Prompt shortcut. For example, press C. The Shortcut key field should display Ctrl + Alt + C.
- Then, select Apply followed by OK at the bottom to save your changes.
Add the Command Prompt Shortcut to the Windows Taskbar
You may want to pin Command Prompt to your taskbar to open the tool with a single click:
- Right-click the Command Prompt shortcut on your desktop and select Pin to taskbar.
- The tool is now on your taskbar.
- To remove this taskbar shortcut, right-click the shortcut and select Unpin from taskbar.
Create a PowerShell Desktop Shortcut on Windows 10
If you use PowerShell, adding PowerShell’s shortcut to your desktop is as easy as adding any other app’s shortcut.
- Launch the Start menu and search for Windows PowerShell.
- Right-click Windows PowerShell in the search results and select Open file location.
- On the following screen, right-click Windows PowerShell and select Open file location.
- You should now see powershell.exe. Right-click this file and select Send to > Desktop (create shortcut).
- You now have a PowerShell shortcut on your Windows desktop.
Run the PowerShell Shortcut With Admin Rights
If you run commands that require admin privileges, configure the PowerShell shortcut to always open the tool with admin rights.
- Right-click the PowerShell shortcut on your desktop and select Properties.
- Select the Shortcut tab in Properties.
- Select the Advanced button in the Shortcut tab.
- In the Advanced Properties window that opens, activate the Run as administrator box and then select OK at the bottom.
- Select Apply and then select OK at the bottom of the window.
- Your PowerShell shortcut will now always open with admin rights.
Create a Keyboard Shortcut to Launch PowerShell
You can assign a shortcut to the PowerShell desktop so that the tool opens with a keystroke.
- Right-click the PowerShell shortcut on your desktop and select Properties.
- Select the Shortcut tab in Properties.
- Select the Shortcut key field and type the keyboard shortcut you want to use. Keep in mind that your shortcut will be prefixed with Ctrl + Alt.
- For example, if you assign P, Windows will treat it as Ctrl + Alt + P.
- Select Apply and then select OK at the bottom to save your shortcut.
Add the PowerShell Shortcut to the Windows Taskbar
For quick access, you can add the PowerShell shortcut to your taskbar.
- Right-click the PowerShell shortcut on your desktop and select Pin to taskbar.
- A PowerShell icon is now added to your taskbar.
- To remove this shortcut, right-click the shortcut on the taskbar and choose Unpin from taskbar.
Bonus Tip: Open Command Prompt or PowerShell’s Taskbar Shortcut With a Keyboard Shortcut
By default, Windows 10 assigns a keyboard shortcut to each app on the taskbar. These shortcuts use a numeric system. Here, the app on the farthest left side of the taskbar is numbered one, and then two, three, and so on.
To use this shortcut, you’d press the Windows key and then the number of your app on the taskbar. For example, if Command Prompt is the fifth numbered shortcut on the taskbar, you’d use Windows + 5 to open the utility.
You can drag the icons on the taskbar in any direction (left or right), and their shortcuts will change accordingly.