How to use command lines on Windows to find files and other stuff to navigate easily?

Windows command line

Technically every windows user knows about command prompts or command line to get quick view of the complex information in your Windows OS and get things organised. In Windows you can launch the command line by typing “cmd” into the search box on the taskbar and hit Enter. Command lines are used to find file, manipulate files and do other necessary stuff. There are over hundred different commands that are used in Windows.

How to use command lines?

Using command lines is easy and simple. Open a Windows command line window by following the steps below.

Click on Start. In the Search or Run line, type cmd (short for command), and press Enter. After following the above steps, the Windows command line should be shown. Typically, Windows starts you at your user directory. Like if the user is xyz so your prompt is C:\Users\xyz>. This prompt tells that you are in the C: drive (the default drive letter of the hard drive) and currently in the xyz directory, which is a subdirectory of the Users directory.

Note that Windows command line are not case sensitive. The files and directories shown in Windows are also found in the command line. When working with a file or directory with a space, surround it in quotes. For example, the directory My Documents would be “My Documents” when typed.

File names can have a long file name of 255 characters and a 3 character file extension. When a file or directory is deleted in the command line, it is not moved into the Recycle Bin. If you need help with any of command type /? after the command. For example, dir /? would give the options available for the dir command.

Few tips and tricks in using the command line for Windows

You need to remember one things that to use commands you need administrator privileges. To get those, launch Task Manager (Ctrl+Shift+Esc), then choose File and Run new task. Enter “cmd” in the box, tick the admin privileges box beneath, and then click OK.

Some of these commands will throw up many screens of text, but you can use the “| more” flag after any of them to go a screen at a time (that’s the pipe character at the start). Alternatively, use “> c:\export.txt” to send the output to a text file, changing its name and location as you like.

To view installed drivers

If you’re troubleshooting hardware problems or just want to know if something’s installed successfully, seeing a list of installed drivers can help: type “driverquery”, hit Enter, and you get a list of all the current Windows drivers, alongside install dates and display names.

Watch star wars in Text via Telnet

Enable Telnet in Windows via Control Panel (click Programs then Turn Windows features on or off), then open up a command prompt window and type “telnet towel.blinkenlights.nl” then hit Enter. Telnet is a network protocol that allows a user on one computer to log into another computer that is part of the same network.

Save folder trees to disk

If you are struggling to get an overview of all the nested folders on a drive, the command line can help. Type “tree” and hit Enter to see the current folder and its subfolders neatly laid out; add “> c:\export.txt” to save the results in a text file that you can browse at your leisure.

You can scan for system problems

If you are facing problems like your windows is shutting down on a regular basis and if you’re currently having problems then the “sfc /scannow” command (which launches the System File Checker tool) checks the most important OS files and fixes them, if possible.

You can get windows show your Wi-Fi password

If you have forgotten your Wi-Fi password then with the command “netsh wlan show profile SSID key=clear”, replacing “SSID” with the Wi-Fi name of the network. If you’re not sure about the networks you’ve connected to, use the “netsh wlan show profile” command.

Also shut down your computer later

You can get your computer to shut down at some point in the future with the “shutdown” command. Add “-t xxx” to shut down with xxx being the number of seconds (from 0 to 315,360,000, which is ten years) and “-f” to force close any ‘you’ve got unsaved work’ dialog boxes. So if you wanted to shut your computer down in 636 seconds you would type “shutdown -f -t 636”.

You can check your laptop’s battery health

The command prompt can give you a pretty detailed and technical readout of the battery health of your laptop (or tablet): Type “powercfg /batteryreport” and hit Enter to generate the report, then open C:\WINDOWS\system32\battery-report.html to view the findings.

Now view your Windows licence key

If you have lost your Windows licence key then you can find it by typing “wmic path softwarelicensingservice get OA3xOriginalProductKey” into the command prompt window and hitting Enter.

You can fix internet problems

The command “ipconfig” shows your network connection status (the gateway is your router, if you need to know its IP), but you can also use “ipconfig /release” and then “ipconfig /renew” to reset your internet connection, which can solve multiple issues.

Find information about your computer

It’s not always easy to work out where to find your computer’s specs — that is, it’s not easy unless you use the command line. Type “systeminfo”, press Enter, and you get a detailed readout of everything from the amount of RAM installed to when the last reboot was.

Wanna delete a file

You can delete the file with the del command. Type del first.bat to delete the first.bat file. If successful, you are returned to the prompt with no errors and the dir command shows no files in the current directory.

When deleting files you can also use wildcards to delete multiple files at once. For example, if the directory contained several .GIF image files you could type del *.gif to delete all files ending with the .gif file extension.

Easily move and copy a file

If you want to move a  file into an alternate directory simply create another directory for the files. So, type mkdir dir2 to create a new directory in the test directory called dir2. After the new directory has been created, use the move command to move the example.bat file into that directory. To do this type move example.bat dir2 at the prompt, if done successfully you should get a message indicated the file was moved. You could also substitute the move command for the copy command to copy the file instead of moving it.

Any file that is an executable file can be run from the command line by typing the name of the file. For example, if you listed files using the dir command and see a file named “myfile.exe” typing “myfile” at the command line runs that program.

After getting a good understanding of using the command line from the steps shown above you can move on to other available commands by typing help at the command line. Typing “help” gives you a listing of available commands with a brief description of each of the commands. Finally when you are done with the Windows command line, you can type exit to close the window.

So command lines help you to navigate your Windows easily and you can create directories and files, rename directories and files, and delete. As mentioned earlier, there are hundreds of other commands that can be used at the command line.  It is the easiest way you want to control things and stuff on your Windows.