如果你是Windows用户很久了,相信你一定用过Command Prompt。即使在今天,CMD也有助于执行许多高级管理功能,并解决与Windows相关的问题。我们之前已经介绍了一些基本命令提示符提示(Basic Command Prompt Tips)。今天我们将看到一些适用于 Windows 10/8/7的更高级的(a-bit-more-advanced)CMD 技巧。
命令提示符或 CMD 技巧
1]直接将错误命令复制(Copying Error Commands)到剪贴板(Clipboard Directly)
很多时候,在执行操作时,您会遇到错误。因此,在通过电子邮件或聊天向有关当局报告之前,您可能会觉得需要将错误复制并粘贴到剪贴板。好吧,通过这个技巧,您可以轻松地将命令输出存储到剪贴板。
为此, 启动命令提示符并简单地添加命令| clip在命令的末尾。例如Dir /d | clip。
2] 查找您的 IP 地址、DNS 服务器(DNS Server)地址等
CMD可让您找出您的 IP 地址。去做这个:
- 在命令提示符处键入ipconfig /all并按Enter。
- 完成后,命令提示符将返回有关 IP 地址和DNS服务器的信息以及有关您的主机名、节点类型、主DNS后缀等的信息。
另外,CMD会让你知道IP Routing、Wins Proxy和DHCP是否启用。
3]检查(Check)是否有人在窃取您的WiFi连接
命令提示符的一大亮点是,它甚至可以让您知道是否有人未经授权访问并使用了您的本地连接(Area Connection)。要检查,请按照下列步骤操作:
- 打开您的网络浏览器并访问 http://192.168.1.1 或 http://192.168.0.1 或宽带路由器的默认 IP 地址。
- 搜索提及“附加设备(Devices)”或类似内容的选项卡。
- 然后,找到您计算机的计算机名称、IP 地址和MAC 地址(MAC Address)或 物理地址(Physical Address)或硬件地址(Hardware Address)。使用上面的技巧。
- 接下来,将其与您的路由器在步骤 2(Step 2)中显示的内容进行比较。如果您注意到一些奇怪的设备,那么您的邻居可能会在未经您同意的情况下共享互联网连接。设置密码!
4]知道(Know)是否有人在入侵您的计算机/追踪黑客
您甚至可以知道是否有人在入侵您的计算机。
- 执行netstat -a命令,它将返回您的计算机连接到的计算机列表。
- 在返回的结果中,您会发现Proto列提供了有关发生的数据传输类型(TCP或UDP)的详细信息,Local address 列提供了有关您的计算机连接到外部计算机的端口的信息。除此之外,您还会注意到“状态”为您提供有关连接状态的信息(连接是否实际建立、等待传输或“超时”)。
- 因此,您可以更轻松地确定您不认识的人是否实际连接到您的计算机。
5]在命令提示符中复制粘贴
如果您一直在寻找一种新的复制粘贴方法,而不是使用右键单击上下文菜单中的选项的传统方法,试试这个!
- 右键单击(Right-click)窗口的命令提示(Prompt)标题栏并选择“属性”
- 然后,在“选项”表下的“属性(Properties)”窗口中启用“快速编辑模式”选项。就是这样!
- 现在,您只需要通过将光标移到它上面来选择文本字符串/字符串,按“Enter”键将选定的文本复制到剪贴板(Clipboard),然后单击鼠标左键将其粘贴到那里。
6]从任何位置(Any Location)打开(Open)命令提示符(Command Prompt)
cd/chdir 命令以到达您想要工作的正确目录可能真的很烦人 。使用下面提到的技巧,您可以在Windows中从您正在查看的任何文件夹中打开命令提示符(Command Prompt)窗口。去做这个:
- 在Windows 资源管理器(Windows Explorer)中打开该文件夹并按住Shift键,同时右键单击该文件夹。
- 然后,选择“在此处运行命令窗口”(Run command window here’) 以打开 CMD 提示符。
- 单击(Click)该选项,您将开始一个新的命令提示符(Command Prompt)实例,准备好并在正确的位置等待!
7]运行多个命令
您可以通过用&&(&&. )分隔来运行多个命令。然而,这受制于一个条件!
- 应该先执行向左的命令
- 成功完成后,可以运行第二个命令。如果第一个命令失败,那么第二个命令将不会运行。
8]显示文件夹结构
使用以下语法显示文件夹树结构
Tree [drive:][path] [/F] [/A]
9]在CMD窗口中拖放(Drop)文件或(Drag)文件夹以(CMD)输入路径
要将文件或文件夹的完整路径自动输入到命令提示符窗口中,只需将文件或文件夹拖放到窗口中即可。这在提升的CMD(CMD)窗口中不起作用。
Let us know if you have any other CMD tricks up your sleeve!
您可能还想查看这些帖子:(You might want to also check out these posts:)
- 如何从 cmd 打开提升的 cmd
- 使用隐藏技巧在 Windows 中观看星球大战
- 如何在 Windows 中通过命令提示符启用 Telnet
- 使用 Windows 命令提示符访问 FTP 服务器(Access FTP Server using Windows Command Prompt)
- Windows 7 中的全屏命令提示符
- 向 Windows 命令提示符添加功能和颜色。
Advanced Command Prompt or CMD Tricks for Windows 10
If you have been a Windows user for a long time, I am surе you must have used Command Prompt. Even tоday, the CMD helps in pеrformіng many advanced administrative functions, and in troubleshooting Windows related issues. We have earlier, already covered some Basic Command Prompt Tips. Today we will see some a-bit-more-advanced CMD tricks for Windows 10/8/7.
Command Prompt or CMD Tricks
1] Copying Error Commands to Clipboard Directly
Many times while performing an operation you get an error. So, you might feel the need for copying and pasting the error to the clipboard before reporting it to the concerned authorities via email or chatting. Well, with this trick you can easily store a command output to a clipboard.
To do this, launch Command Prompt and simply add the command | clip at the end of the command. For e.g. Dir /d | clip.
2] Finding your IP address, DNS Server address, and a lot more
CMD lets you find out your IP address. To do this:
- Type ipconfig /all at the command prompt and press Enter.
- Once done, the command prompt will return you information on IP address and DNS servers along with information on your hostname, node type, primary DNS suffix, etc.
Also, CMD will let you know whether IP Routing, Wins Proxy, and DHCP are enabled or not.
3] Check if anyone is stealing your WiFi connection
One highlight of the command prompt is that it can even let you know if someone is having unauthorized access to your Local Area Connection and using it. To check, follow these steps:
- Open your web browser and visit http://192.168.1.1 or http://192.168.0.1 or the default IP address for your broadband router.
- Search for the tab mentioning ‘Attached Devices’ or something similar.
- Then, find the computer name, IP address, and MAC Address or Physical Address or Hardware Address, of your computer. Use the above trick.
- Next, compare it with those displayed by your router in Step 2. If you notice some strange devices, then there is a possibility that your neighbor is sharing the internet connection without your consent. Set a password!
4] Know if someone is hacking your computer/Trace a Hacker
You can even know if someone is hacking your computer.
- Execute the netstat -a command and it will return you a list of computers that your computer is connected to.
- In the results returned, you will find the Proto column giving details on the type of data transmission taking place (TCP or UDP), Local address column giving information on the port with which your computer is connected to an external computer. In addition to this, you will also notice ‘State’ providing you information on the state of the connection (whether a connection is actually established, or waiting for transmission or is “Timed Out”).
- Thus, it will be easier for you to determine if someone you don’t know is actually connected to your computer or not.
5] Copy-Paste in Command Prompt
If you have been looking for a new method to copy-paste rather than the conventional one of using the option from the right-click context menu, try this!
- Right-click on the command Prompt title bar of the window and chose ‘Properties’
- Then, in the Properties window under the ‘Option’ table enable the ‘Quick Edit Mode’ option. That’s it!
- Now, you just need to select text string/strings by moving the cursor over it, press the ‘Enter’ key to copy the selected texts to Clipboard and do a left-click to paste it there.
6] Open the Command Prompt from Any Location
It can be really annoying to execute the cd/chdir command over and over again to get to the right directory you want to work from. With the trick mentioned below, you could open a Command Prompt window from any folder you’re viewing, in Windows. To do this:
- Open the folder in Windows Explorer and hold the Shift key while making a right-click on the folder.
- Then, select ‘Run command window here’ to open the CMD prompt.
- Click on the option and you’ll begin a new instance of the Command Prompt, ready and waiting at the right location!
7] Run multiple commands
You can run multiple commands by separating them with &&. This, however, is subjected to one condition!
- The command towards the left should be executed first
- Once it completes successfully then the second command can be made to run. If the first command fails, then the second command will not run.
8] Show folder structure
Use the following syntax to show the folder tree structure
Tree [drive:][path] [/F] [/A]
9] Drag and Drop files or folders in CMD window to enter path
To get the full path of the file or folder auto-entered into your command prompt window, simply drag and drop the file or folder into the window. This will not work in an elevated CMD window.
Let us know if you have any other CMD tricks up your sleeve!
You might want to also check out these posts:
- How to open an elevated cmd from a cmd
- Watch Star Wars in Windows using a hidden trick
- How to enable Telnet through Command Prompt in Windows
- Access FTP Server using Windows Command Prompt
- Full-screen command prompt in Windows 7
- Add features & color to Windows Command Prompt.