Difference between revisions of "Command Line Tools"
(11 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
Windows originally was an add-on to DOS, the Microsoft "Disk Operating System", in order to make it more user friendly and more appealing to new/novice computer users. It's commonly known as a "GUI", which stands for "Graphical User Interface". | Windows originally was an add-on to DOS, the Microsoft "Disk Operating System", in order to make it more user friendly and more appealing to new/novice computer users. It's commonly known as a "GUI", which stands for "Graphical User Interface". | ||
<br /><br /> | <br /><br /> | ||
− | To new users, the thought of typing manual commands from a black "DOS" screen can seem intimidating and complicated. However, there is MUCH power that is available in that dark deep hole most users don't bother with. The "Real" power comes from creating scripts to make things easier, even to the point of automation. Scripts are merely one or more "DOS" commands saved as a file that can be run again and again, while modifying the script if needed to improved it's functionality. | + | To new users, the thought of typing manual commands from a black "DOS" screen can seem intimidating and complicated. However, there is MUCH power that is available in that dark deep hole most users don't bother with, known as the "Command Line". The "Real" power comes from creating scripts to make things easier, even to the point of automation. Scripts are merely one or more "DOS" commands saved as a file that can be run again and again, while modifying the script if needed to improved it's functionality. |
<br /><br /> | <br /><br /> | ||
Here is the beginning of my soon to become ever-growing list of commonly used, and not so commonly used command line commands, along with examples of their usage: | Here is the beginning of my soon to become ever-growing list of commonly used, and not so commonly used command line commands, along with examples of their usage: | ||
Line 12: | Line 12: | ||
<br /> | <br /> | ||
* findstr | * findstr | ||
− | ** This command searches for text within a file. You can give it the -i flag to ignore case-sensitivity. | + | ** This command searches for text within a file. You can give it the -i flag to ignore case-sensitivity. It can also be used to find specific output of another command, using the pipe(|), which looks like a vertical line, and is usually typed using the key just above the "ENTER" key on the keyboard, requiring a "shift-backslash" to produce the "|" pipe symbol. This is known as piping the output of most commands into the "findstr" command. |
− | <br /> | + | ** Here's an example of piping the output of one command, the "ipconfig /all" command, into another command, in this case, the "findstr" command to search for all lines that contain "v4", which is this case, is only one, the line we want to see the IP address of the computer. |
+ | <pre style="color:blue"> | ||
+ | PS C:\Users\jamie> ipconfig /all | findstr v4 | ||
+ | IPv4 Address. . . . . . . . . . . : 192.168.200.210(Preferred) | ||
+ | </pre> | ||
+ | <br /> | ||
* recoverydrive.exe | * recoverydrive.exe | ||
** Starts up the GUI to create a USB recovery drive, with the option of including backup copy of "System Files" on the USB device. Requires a new or empty USB drive with a 32GB capacity or greater. | ** Starts up the GUI to create a USB recovery drive, with the option of including backup copy of "System Files" on the USB device. Requires a new or empty USB drive with a 32GB capacity or greater. | ||
+ | <br /> | ||
* net stats workstation OR net stats server | * net stats workstation OR net stats server | ||
** Displays statistics of a PC workstation or server. Among other information, it shows how long the computer has been powered up since last shutdown or restart. The line starting with "Statistics since" shows the date and time the computer was booted up. This is commonly known as the computer's "uptime". | ** Displays statistics of a PC workstation or server. Among other information, it shows how long the computer has been powered up since last shutdown or restart. The line starting with "Statistics since" shows the date and time the computer was booted up. This is commonly known as the computer's "uptime". | ||
** Here is an example showing the full output of the command on a Windows 11 system: | ** Here is an example showing the full output of the command on a Windows 11 system: | ||
− | <pre style=" | + | <pre style="color:blue"> |
PS C:\Users\jamie> net stats workstation | PS C:\Users\jamie> net stats workstation | ||
Workstation Statistics for \\WIN11VM05 | Workstation Statistics for \\WIN11VM05 | ||
Line 51: | Line 57: | ||
</pre> | </pre> | ||
<br /> | <br /> | ||
+ | As demonstrated previously with the "findstr" command, you can "filter" the output of this or any command, into the findstr command to narrow down your search results, in order to give you only the information you are interested in, and not all the extraneous information also produced by most command's outputs. | ||
+ | <br /> | ||
+ | Here is an example of finding out just the last time the computer was starterd/booted, or restarted, which shows you how long the computer has been powered up since it was turned on. This is very useful in diagnosing many issues, as often times, a user will go for very long periods of time without rebooting, which is not a good thing with the Windows operating system(OS), as system memory and other resources can be consumed and not freed up properly by programs/applications when they are closed. | ||
+ | <br /> | ||
+ | In this example on a Windows 10 machine, I find a word or group of words that is unique to the line that contains the information I am looking for, and use it as the "keyword" to search the output of the prior command using the "findstr" command. The word "since" only appears in the line starting with "Statistics since", so by having "findstr" search for the line containing "Statitics since", it produces the only line that contains the information we want, the time since the computer was turned on! | ||
+ | <pre style="color:blue"> | ||
+ | C:\Users\jamie.DAWGLAND.000>net stats workstation | findstr since | ||
+ | Statistics since 5/22/2023 1:53:47 AM | ||
+ | </pre> | ||
+ | <br /><br /> | ||
+ | |||
+ | === '''Other Miscellaneous Command-Line Tools''' === | ||
+ | <br /> | ||
+ | * didskmgmt.msc | ||
+ | ** Opens the Windows disk management GUI tool used to view and modify disk partitions and disk types | ||
+ | <br /> | ||
+ | * control update | ||
+ | ** Open the Windows Update GUI tool to find and install Windows and other Microsoft software upgrades | ||
+ | <br /> | ||
+ | More plus Windows Server tool included can be found at http://www.auditiait.es/en/list-of-commands-msc/ | ||
+ | < br/><br /> |
Latest revision as of 22:12, 9 April 2024
Windows Command Line Tools & Commands
Common to All Versions of Windows
Windows originally was an add-on to DOS, the Microsoft "Disk Operating System", in order to make it more user friendly and more appealing to new/novice computer users. It's commonly known as a "GUI", which stands for "Graphical User Interface".
To new users, the thought of typing manual commands from a black "DOS" screen can seem intimidating and complicated. However, there is MUCH power that is available in that dark deep hole most users don't bother with, known as the "Command Line". The "Real" power comes from creating scripts to make things easier, even to the point of automation. Scripts are merely one or more "DOS" commands saved as a file that can be run again and again, while modifying the script if needed to improved it's functionality.
Here is the beginning of my soon to become ever-growing list of commonly used, and not so commonly used command line commands, along with examples of their usage:
- "netsh interface IPV6 set privacy state=disable"
- Disables IPv6 on all network interfaces.
- findstr
- This command searches for text within a file. You can give it the -i flag to ignore case-sensitivity. It can also be used to find specific output of another command, using the pipe(|), which looks like a vertical line, and is usually typed using the key just above the "ENTER" key on the keyboard, requiring a "shift-backslash" to produce the "|" pipe symbol. This is known as piping the output of most commands into the "findstr" command.
- Here's an example of piping the output of one command, the "ipconfig /all" command, into another command, in this case, the "findstr" command to search for all lines that contain "v4", which is this case, is only one, the line we want to see the IP address of the computer.
PS C:\Users\jamie> ipconfig /all | findstr v4 IPv4 Address. . . . . . . . . . . : 192.168.200.210(Preferred)
- recoverydrive.exe
- Starts up the GUI to create a USB recovery drive, with the option of including backup copy of "System Files" on the USB device. Requires a new or empty USB drive with a 32GB capacity or greater.
- net stats workstation OR net stats server
- Displays statistics of a PC workstation or server. Among other information, it shows how long the computer has been powered up since last shutdown or restart. The line starting with "Statistics since" shows the date and time the computer was booted up. This is commonly known as the computer's "uptime".
- Here is an example showing the full output of the command on a Windows 11 system:
PS C:\Users\jamie> net stats workstation Workstation Statistics for \\WIN11VM05 Statistics since 5/11/2023 12:38:03 AM Bytes received 0 Server Message Blocks (SMBs) received 2 Bytes transmitted 0 Server Message Blocks (SMBs) transmitted 0 Read operations 0 Write operations 0 Raw reads denied 0 Raw writes denied 0 Network errors 0 Connections made 0 Reconnections made 0 Server disconnects 0 Sessions started 0 Hung sessions 0 Failed sessions 0 Failed operations 0 Use count 0 Failed use count 0 The command completed successfully.
As demonstrated previously with the "findstr" command, you can "filter" the output of this or any command, into the findstr command to narrow down your search results, in order to give you only the information you are interested in, and not all the extraneous information also produced by most command's outputs.
Here is an example of finding out just the last time the computer was starterd/booted, or restarted, which shows you how long the computer has been powered up since it was turned on. This is very useful in diagnosing many issues, as often times, a user will go for very long periods of time without rebooting, which is not a good thing with the Windows operating system(OS), as system memory and other resources can be consumed and not freed up properly by programs/applications when they are closed.
In this example on a Windows 10 machine, I find a word or group of words that is unique to the line that contains the information I am looking for, and use it as the "keyword" to search the output of the prior command using the "findstr" command. The word "since" only appears in the line starting with "Statistics since", so by having "findstr" search for the line containing "Statitics since", it produces the only line that contains the information we want, the time since the computer was turned on!
C:\Users\jamie.DAWGLAND.000>net stats workstation | findstr since Statistics since 5/22/2023 1:53:47 AM
Other Miscellaneous Command-Line Tools
- didskmgmt.msc
- Opens the Windows disk management GUI tool used to view and modify disk partitions and disk types
- control update
- Open the Windows Update GUI tool to find and install Windows and other Microsoft software upgrades
More plus Windows Server tool included can be found at http://www.auditiait.es/en/list-of-commands-msc/
< br/>