Command Prompt – How to use the simple, basic commands

by Codrut Neagu published on 05/11/2016. digitalcitizen . life

Geeks and experts all love the Command Prompt because of the advanced tasks and commands you can run in it. But that doesn’t mean that it’s only useful for experts – after all, every expert was a novice in the beginning. And Command Prompt is not built only on advanced commands, but also on simple commands designed to perform basic operations. In this article we will show you how to execute commands like changing the working folder, viewing the contents of a directory, creating and renaming folders, copying, deleting files and folders, and launching any application from the Command Prompt. We will also see how to get help when using this tool.

NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1 and Windows 7. Note that, for simplicity, we will use screenshots taken only in Windows 10.

How to navigate between folders


The first command from the list is CD (Change Directory). This command enables you to change the current folder or, in other words, to navigate to another folder from your computer.

For instance, the command CD\ takes you to the top of the directory tree. To see how it works, after you open the Command Prompt, type cd\ and press Enter on your keyboard. You will see that the CD\ command takes you to the top of the directory tree (in this case to the “C:” drive).

Opera Snapshot_2018-01-11_220304_www.digitalcitizen.life

NOTE: Command Prompt is not case sensitive, meaning that commands can be typed with capital letters, lowercase or any combination of them. The commands CD, cd or Cd will all work in the same way.

Going back to the “CD\” command, now you are working on the root of the “C:” drive. If you need to go to a specific folder from this drive run the command “CD Folder”. The subfolders must be separated by a backslash character: “\”. For instance, when you need to access the System32 folder located in “C:\Windows”, type “cd windows\system32\” as shown below, and then press Enter on your keyboard.

Opera Snapshot_2018-01-11_220416_www.digitalcitizen.life

When you need to go to one folder up, use the “cd..” command. Let’s assume that you want to go back to the Windows folder. Type “cd..” and press Enter on your keyboard. You will notice that your current directory has changed to ”C:\Windows”.

Opera Snapshot_2018-01-11_220459_www.digitalcitizen.life

How to access a certain drive


To access another drive, type that drive’s letter, followed by “:”. For instance, if you wanted to change the drive from “C:” to “D:”, you should type “d:” and then press Enter on your keyboard.

Opera Snapshot_2018-01-11_220631_www.digitalcitizen.life

To change the drive and the directory at the same time, use the cd command, followed by the “/d” switch. The “/d” parameter is used to change the current drive to a specific folder from another disk volume. For instance, if you are now on the ”D:” drive and you want to go back to the Windows folder from the“C:” drive, you should type “cd /d C:\Windows” and press Enter on your keyboard, like in the following screenshot.

Opera Snapshot_2018-01-11_220737_www.digitalcitizen.life

NOTE: By typing the drive letter you automatically move to your most recent location in that drive. For instance, if you are on “D:” drive and type “cd c:\windows” nothing seems to happen. But if you type “c:”, then the working folder will change to “c:\windows” (assuming that it was the last folder you worked with on your “C:” drive).

How to view the contents of a folder
You can view the contents of a folder by using a simple command called DIR. To test it, we’ve created a folder named Digital_Citizen on the D: drive, with several files and subfolders.

Opera Snapshot_2018-01-11_220903_www.digitalcitizen.life

The last time, our working folder was “C:\Windows”. We will navigate to the folder mentioned above by using the command “cd /d D:\Digital_Citizen”. To view the contents of the folder we will type DIR and press Enter on the keyboard. A list of the files and folders contained by it is displayed, together with some details about them (the size and the date and time when they were last modified).

Opera Snapshot_2018-01-11_221019_www.digitalcitizen.life

How to create a new folder from the Command Prompt


You can make a new directory using the MKDIR (Make Directory) or the MD command. The syntax of these commands is “MKDIR Folder” or “MD Folder”.

Let’s say we need to create a new folder called Digital_Citizen_Life that will be placed in the “D:\Digital_Citizen” folder. We will type “mkdir Digital_Citizen_Life” and then we will press Enter, as shown below.

Opera Snapshot_2018-01-11_221127_www.digitalcitizen.life

To test if it worked, we will use again the dir command. The newly created folder appears in the list.

Opera Snapshot_2018-01-11_221242_www.digitalcitizen.life

NOTE: Don’t forget that all these commands depend on the current location in the Command Prompt. For instance, if you are on the “C:” drive and type “MKDIR test”, a new folder will be created in the root of the “C:” drive.

Another way to create a folder, that doesn’t involve being in the desired folder, is to type the complete path of the new folder. For example, if you are working on the “D:” drive and you want to create a new folder in “C:”, called other_stuff, type “mkdir c:\other_stuff” and then press Enter.

Opera Snapshot_2018-01-11_221351_www.digitalcitizen.life

When you need to create a folder with subfolders at the same time you can use the ”MKDIR Folder\Subfolder” command . For instance, if we type “mkdir Digital_Citizen_Tests\Beta\Test1” three folders will be created: Digital_Citizen_Tests, Beta and Test1, in a tree-like structure.

Opera Snapshot_2018-01-11_221504_www.digitalcitizen.life

How to rename files and folders


To rename files and folders you need to use the REN (Rename) command.

To rename folders, type “ren Folder NewFolderName”. For example, if we wanted to rename the Digital_Citizen_Tests folder to Digital_Citizen_Final_Tests, we should run “ren Digital_Citizen_Tests Digital_Citizen_Final_Tests” and then press Enter.

Opera Snapshot_2018-01-11_221607_www.digitalcitizen.life

To rename a file, use the same command, like this: “ren filename.extension newname.extension”. For instance, to rename the Digital_Citizen_Picture.jpg file to Picture1.jpg we have to run the command “ren Digital_Citizen_Picture.jpg Picture1.jpg” command.

Opera Snapshot_2018-01-11_221708_www.digitalcitizen.life

Copy files and folders


The Copy command allows you to copy files from one location to another. To use this command you have to type

“copy location\filename.extension newlocation\newname.extension”.

For example, let’s use this command to copy the Picture1.jpg file from the Digital_Citizen folder located on the “D:” drive to the

“D:\Digital_Citizen\Digital_Citizen_Tests\ folder.

To make things more interesting we want the file to be named Testing_Picture1.gif. We will write the command

“copy D:\Digital_Citizen\picture1.jpg

:\Digital_Citizen\Digital_Citizen_Tests\testing_picture1.gif”

followed by Enter. You will receive a confirmation of the operation, as you can see below.

Opera Snapshot_2018-01-11_221914_www.digitalcitizen.life

If you are copying within the same directory you don’t have to put the path in command. As an example, we will copy Digital_Citizen_Notes.txt from “D:\Digital_Citizen” in the same folder, only with a different extension: let’s say Digital_Citizen_Notes.doc. To do that, we have to run the command “copy Digital_Citizen_Notes.txt Digital_Citizen_Notes.doc”.

Opera Snapshot_2018-01-11_222022_www.digitalcitizen.life

To copy a folder and its content from a location to another, use the XCOPY command followed by the “/s /i” operators. Let’s assume that we need to copy a folder from “D:\Digital_Citizen” to “C:\Backup_Digital_Citizen”. To do that, we’ll have to run the command “xcopy /s /i d:\Digital_Citizen c:\Backup_Digital_Citizen”. The “/s” parameter will ensure that all the directories and subdirectories will be copied, except the ones that are empty. The ‘/i’ parameter will create a new directory if the destination folder doesn’t exist and will copy all the files.

Opera Snapshot_2018-01-11_222122_www.digitalcitizen.life

Delete files and folders


The DEL (Delete) is used to delete files from the folders you’ve created. To delete all the files from a folder you have to run the command “del folder”. For instance, from the directory Digital_Citizen found on the “D:” drive, we will delete all the files from the Digital_Citizen_Tests folder, by typing the command “del Digital_Citizen_Tests”. You need to confirm the delete process by typing the letter “y” and then press Enter.

NOTE: To also delete hidden files from the folder, you must add the “/h” parameter. Also note that the DEL command doesn’t work for deleting folders – for that, you’ll have to use the RD command of which we’ll talk in a bit.

Opera Snapshot_2018-01-11_222236_www.digitalcitizen.life

If you need to delete a single file, use the DEL command followed by that file’s name. For instance, to delete the file Digital_Citizen_Notes.txt from “D:\Digital_Citizen”, we should run the command “del Digital_Citizen_Notes.txt”.

Opera Snapshot_2018-01-11_222340_www.digitalcitizen.life

Here is a list of useful DEL combinations that are worth mentioning:

  • DEL *.DOC – delete all files with the DOC extension (you can use any file extension necessary, DOC is just an example);
  • DEL Test*.* – delete all files beginning with Test;
  • DEL *.* – delete ALL files from the current folder.

The DEL command cannot be used to delete folders, therefore we will use another command to remove any empty folder: RD (Remove Directory). We’ve previously deleted all the files from the Digital_Citizen_Tests folder. It’s time to delete it by typing ”RD Digital_Citizen_Tests”.

Opera Snapshot_2018-01-11_222507_www.digitalcitizen.life

Launch an application from the Command Prompt


To run a program from the Command Prompt, you need only to navigate to the folder that contains the executable and type the program’s name. For example, if you want to launch Paint using Command Prompt, go to “C:\Windows\System32” and you will find the executable called mspaint.exe. Let’s see how this operation is done, if you were in “D:\Digital_Citizen”. First off all, change the working directory to the application’s folder by typing “cd /d c:\windows\System32\”. Then write mspaint.exe or simply mspaint and press Enter. Both commands can be seen in the screenshot below.

Opera Snapshot_2018-01-11_222612_www.digitalcitizen.life

How to get help in Command Prompt


To access help in Command Prompt you have to type the help command and then press Enter. A list with all available commands will be displayed, as you can see below.

Opera Snapshot_2018-01-11_222824_www.digitalcitizen.life

If a certain command interests you, type help followed by the name of that command. Another way to do the same thing is to type the command’s name followed by the “/?” parameter. To test it, use “help cd” or “cd/?” to display information about the cd command. In the picture below you can see the result.

Opera Snapshot_2018-01-11_223010_www.digitalcitizen.life

Conclusion


The Command Prompt remains a very powerful tool for any computer user who is willing to get his hands dirty and learn new things. We hope this article was useful in helping you learn the basics about running commands in the Command Prompt. If you have any questions about it, don’t hesitate to leave us a comment below.

Advertisements

Command Prompt – View system information and manage running processes

by Codrut Neagu published on 05/26/2016. digitalcitizen . life

The easiest way to view information about your computer is to use Windows built-in graphical tools like the Task Manager or System Information . However, just like us, some people prefer to use the Command Prompt for, well, anything. That’s why, in this article, we thought it would be useful to show you how to view the complete system information directly from the Command Prompt , as well as how to manage your running processes, all with the use of just a few advanced commands:

NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1 and Windows 7. For simplicity, we will use screenshots taken in Windows 10.

1. How to view your system information


Command Prompt allows you to view system information by using a simple command called systeminfo . Open Command Prompt , type systeminfo and press Enter . Do you s ee what’s happening? Just like in screenshot below, a complete list of information about your operating system and computer hardware and software components is displayed.

You will see details such as the version of the operating system installed on your computer, the status of your RAM memory or the processor you have. There’s also some network information, like the IP and the MACaddresses of your network cards.

command_prompt_0

2. Display the list of currently running processes


To view the list of currently running processes, you have to use the tasklist command. Type tasklist and press Enter . Command Prompt should display a list similar to the one below, where you see details about the names of running processes, their PID (Process identifier) and the memory they use.

command_prompt_1

3. Stop a process using taskkill


To kill or stop a running process, you have to use the taskkill command. Let’s assume that you want to stop the Snipping Tool application t hat is running on your computer. Its process is called SnippingTool.exe . In order to kill it, you should use Command Prompt to run the command “taskkill /im snippingtool.exe” . The /im parameter is used to identify and stop a process by typing its name.

command_prompt_2

There are times when you need to open a program twice or even several times. Every new window of a specific program (for example, Internet Explorer ) creates a separate process called instance that has attached a unique PID (Process identifier).

To stop a single instance of a process, you need to specify its PID(Process identifier). Let’s assume that there are two instances of Internet Explorer open on your computer . The process’ name is iexplore.exe , but you want to close only one of its two running instances.

command_prompt_3

If you want to kill the process that has a PID of 6984, you will type taskkill /PID 6984 and then press Enter .

command_prompt_4

Another interesting parameter that you can use for the command taskkill is /t . This parameter allows you to terminate a specified process and any child processes which were started by it.

Take the same example: the Internet Explorer process. Let’s assume that you have three processes and you want to kill all of them using the parameter /t . You should type the command “taskkill /t /im iexplore.exe” and then press Enter . Check the screenshot below to see the confirmation of the command you just typed.

command_prompt_5

Note that if you misuse the commands listed in this article, you can risk losing the data opened in the running processes. It is important to be careful and have a backup available for your data. Therefore proceed carefully and don’t say we did not warn you. 🙂

Also, keep in mind that, in order to kill any running process, you need to have administrative permissions and run the Command Prompt as administrator. Check out the 7 ways to run programs as administrator in Windows to see how to run Command Prompt as administrator.

Conclusion


We hope you’ve liked this guide which continues our series of advanced commands that can be run in the Command Prompt . Now you know how to display the system information and you know how to stop processes, all by using just some text commands in the Command Prompt . Don’t you feel geeky right now? 🙂 Don’t forget that, if you have any questions about the commands shared in this article, you can always leave a comment below.

 

How To Repair Missing Or Corrupt Windows Files From The Command Prompt

by Codrut Neagu published on 02/19/2015. digitalcitizen . life

When you have problems with your computer, Windows system files may become corrupted or go missing. This might be caused by all kinds of issues like sudden power drops, hardware malfunctions, a hard disk approaching its “death” and so on. If Windows reports that it cannot start because some of its files are corrupted or missing, you should use the System File Checker (SFC) tool in the Command Prompt. You should do the same when Windows starts to Blue Screen on you with weird corruption related errors. SFC scans all the Windows system files on your computer, identifies those that are corrupt or missing and tries to fix the problems it find. Here’s how to use it:

NOTE: This tutorial applies to both Windows 7 and Windows 8.1.

How To Fix Problems With Missing Or Corrupted Files When Windows Won’t Boot


If Windows doesn’t load because of missing or corrupt system files, follow this tutorial to start the Command Prompt: How To Start The Command Prompt When Windows Doesn’t Boot?.

In the Command Prompt window, use the sfc command with two additional parameters:

  • /offbootdir – used to specify the partition that contains the system files that are required for booting Windows. In most cases, this partition is going to be “C:\”.
  • /offwindir – used to specify the location of the Windows directory. In most cases, this folder is “C:\Windows”.

You will need to type something like: 

sfc /scannow /offbootdir=c:\  /offwindir=c:\windows and press Enter.

Opera Snapshot_2018-01-10_193256_www.digitalcitizen.life

The “translation” for this command is the following: scan the Windows folder located on the boot partition “C:\”and fix missing or corrupt system files.

Arm yourself with some patience because running this command will take quite a bit of time. When the process finishes, you are informed that the verification is 100% complete. If problems were found, you are also informed. The problematic files that cannot be fixed are always mentioned in a log file named CBS.log. This file is found in the Windows folder, at this location: “C:\Windows\Logs\CBS\CBS.log”.

If everything is fine with your system files, you will receive a message saying that: “Windows Resource Protection did not find any integrity violations”.

How To Fix Problems With Missing Or Corrupted Files When Windows Boots


You may also find yourself in a scenario where Windows loads successfully but it crashes randomly with a Blue Screen of Death (BSOD) mentioning corruption errors. If that is the case for you, start the Command Prompt as an administrator, using any of the methods described in this tutorial: 7 Ways to Launch the Command Prompt in Windows 7 & Windows 8.

Type the command: sfc /scannow and press Enter. The /scannow parameter forces the SFC tool to scan the integrity of all system files and repair problematic files when possible.

Opera Snapshot_2018-01-10_193522_www.digitalcitizen.life

Again, arm yourself with some patience. The tool takes a long time to run. At least a couple of minutes. When it’s done, you are informed that the verification is 100% complete. If problems were found, you are also informed.

In our case, SFC found corrupt files and it was unable to fix some of them.

Opera Snapshot_2018-01-10_193804_www.digitalcitizen.life

The problematic files that cannot be fixed are always mentioned in a log file named CBS.log. This file is found in the Windows folder, at this location: “C:\Windows\Logs\CBS\CBS.log”.

How To Analyze The CBS.Log File


Go to “C:\Windows\Logs\CBS” and open the CBS.log. This file is quite large and it takes a while to open it in Notepad. If possible, open it with a different application like Notepad++ or Microsoft Word, so that it is opened faster and you have an easier time working with it.

Opera Snapshot_2018-01-10_193854_www.digitalcitizen.life

Scroll towards the end of the file and search for entries that start with the text: “Cannot repair member file”. There you will find the missing or corrupted system file(s) that cannot be repaired.

Opera Snapshot_2018-01-10_194040_www.digitalcitizen.life

Search for information online about the file(s) mentioned in this log file and from there on you might get an idea on how to fix your problems.

Conclusion


Hopefully you will never need to use the SFC command to repair Windows systems files. However, if you do have issues, don’t hesitate to consider using it. This tutorial should come in handy when you have to deal with system files being corrupted or missing.

If you are looking for other useful troubleshooting tutorials, read the articles recommended below.

 

How to use the Command Prompt to fix issues with your PC’s boot records

by Codrut Neagu published on 02/02/2017. digitalcitizen . life

You can use system recovery tools to fix most of your computer problems. However, there are times when you’ll need to address such issues in a manual way, like, for example, when your Windows computer won’t boot. In these cases, you can use a tool named Bootrec.exe. It can help you troubleshoot and repair things like the Master Boot Record (MBR), the boot sector or the Boot Configuration Data (BCD) store. Here’s how it works, in all modern versions of Windows:

NOTE: This guide covers Windows 10, Windows 7 and Windows 8.1.

Bootrec.exe – The ultimate repair tool for boot problems in Windows


No matter whether you use Windows 7 or Windows 10, if your operating system has trouble booting and Startup Repair can’t fix the problem, it’s worth trying the Bootrec.exe tool. With this tool you can repair the Master Boot Record (MBR), write a new boot sector, rebuild the Boot Configuration Data (BCD) and add missing Windows installations to the boot configuration data.

If you need to know what all these mean, here’s an explanation for each of them:

  • Master Boot Record (MBR) – the first sector of your system drive. Its purpose is to tell the computer’s BIOS where to look for the operating system, so that it can start it.
  • Boot Sector – the region of the disk that contains the code to be loaded into the RAM memory, that is necessary to load the operating system. A boot sector must have a specific disk signature to be seen by BIOS as a boot sector. If this signature is corrupted, or has been changed, the BIOS will not be able to find the boot sector and won’t be able to load the necessary instructions for finding and starting the operating system. In Windows 7 and newever versions of Windows, the boot sector loads the Windows Boot Manager, accesses the Boot Configuration Data and uses this information to load the operating system
  • Boot Configuration Data (BCD) – The BCD is a database of boot-time configuration data that is used by the Windows Boot Manager. The Boot Configuration Data is stored in a data file that has the same format as the Windows Registry.

How to start the Command Prompt when Windows won’t load successfully


In order to be able to use Bootrec.exe, you’ll have to use Command Prompt. However, because you already have startup issues, it’s obvious that you won’t be able to simply run it from Windows.

You need to use a repair disc or a recovery drive that was created on a working Windows computer. Here are some guides that will help you create such discs/drives:

  • What is a system repair disc and how to create one in Windows – this guide applies to all modern versions of Windows. Windows 7 users can only use this method if they want to have a chance at repairing the computer. The repair disc can be a CD or DVD with all the necessary files for troubleshooting your system
  • How to create a recovery drive in Windows 10 – learn how to create a bootable USB memory stick with recovery tools for Windows 10.
  • How to create a recovery drive on a USB memory stick in Windows 8 & 8.1 – this guide is useful for Windows 8 users only.

Once you have recovery drive/disc created, boot from it. In order to do that, plug it in and start your Windows computer or device. Immediately after it starts, press the boot device selection key on your keyboard. It’s usually the F12, F11 or the Escape key, but it could be another as well, depending on the manufacturer of your device’s mainboard. Doing that will make your computer display a boot priority selection menu. Use the arrow keys on the keyboard to select the recovery drive. Then, press Enter and, when asked to press any key to boot from that drive, do so.

Opera Snapshot_2018-01-10_185716_www.digitalcitizen.life

If you are using Windows 10 or Windows 8.1, once your PC boots from the USB drive, you will be asked to choose the keyboard layout that you want to use. When this happens, click or tap on the layout that matches your keyboard. To navigate between all the available keyboard layouts, press “See more keyboard layouts”.

Opera Snapshot_2018-01-10_185801_www.digitalcitizen.life

The list of available keyboard languages is quite long and you may have to scroll a lot until you find the layout that you want to use. On the next screen, you should click or tap on Troubleshoot (Reset your PC or see advanced options).

Opera Snapshot_2018-01-10_185932_www.digitalcitizen.life

On the Advanced options screen, click or tap on Command Prompt.

Opera Snapshot_2018-01-10_190124_www.digitalcitizen.life

If you are using Windows 7, first, select the keyboard input method that you want to use and click Next.

Opera Snapshot_2018-01-10_190309_www.digitalcitizen.life

Then, it scans for available Windows installations and lists those that are found. Select the Windows 7 installation that you want to repair and click Next.

Opera Snapshot_2018-01-10_190351_www.digitalcitizen.life

Then, when the list of available System Recovery Options are shared, click Command Prompt.

Opera Snapshot_2018-01-10_190453_www.digitalcitizen.life

Once you’ve launched the Command Prompt, type the command bootrec.exe and hit Enter to see the options that are available for this tool. As you can see in the screenshot below, there are four parameters available: /FixMbr, /FixBoot, /ScanOs and /RebuildBcd.

Opera Snapshot_2018-01-10_190600_www.digitalcitizen.life

Let’s see how each of them can help you solve your computer’s boot problems. Keep in mind though, that even if the Bootrec.exe tool can handle most boot problems, it does not guarantee success in every possible situation.

How to repair the Master Boot Record (MBR)


The first parameter of the Bootrec.exe tool is /FixMbr. It allows the repair of a corrupted or damaged Master Boot Record (MBR). Usually, you will use this parameter when you are faced with one of these error messages: “Operating System not found”, “Error loading operating system”, “Missing operating system” or “Invalid partition table”. To start the repair process of the MBR, run the command: bootrec.exe /fixmbr.

Opera Snapshot_2018-01-10_190827_www.digitalcitizen.life

How to write a new boot sector


The /FixBoot parameter writes a new boot sector to the system partition. The tool will use a boot sector that is compatible with your Windows version. Using this parameter is useful in the following situations:

  • The boot sector has been replaced with a non-standard Windows boot sector;
  • The boot sector is damaged;
  • An earlier Windows operating system has been installed after your version of Windows was installed.

To start writing a new boot sector, use this command: bootrec.exe /fixboot.

Opera Snapshot_2018-01-10_191050_www.digitalcitizen.life

How to rebuild the Boot Configuration Data (BCD)


The Boot Configuration Data (BCD) contains a detailed list of what is supposed to load at startup. Microsoft indicates that a boot error can also be caused by missing or damaged files in the BCD. The /rebuildbcdparameter can be very useful when you must fix some errors by completely rebuilding the BCD. To completely rebuild the Boot Configuration Data, run this command: bootrec.exe /rebuildbcd.

Opera Snapshot_2018-01-10_191140_www.digitalcitizen.life

How to add missing Windows installations to the Boot Configuration Data


If your computer has multiple operating systems installed but not all of them are available, use the /ScanOSoption. Using this parameter on Bootrec.exe will launch a scan on all disks for any Windows installations that are not currently included in the Boot Configuration Data (BCD). In the screenshot below, you can see how this scan process might look.

Opera Snapshot_2018-01-10_191301_www.digitalcitizen.life

If the bootrec.exe /scanos command returns results, you will be able to continue the repair process. In the end, you will get the lost Windows installation back into the secure BCD table, thus making it bootable again.

Opera Snapshot_2018-01-10_191437_www.digitalcitizen.life

First of all, you have to clean the Master Boot Record (MBR) by using bootrec /fixmbr. Next, type bootsect.exe /nt60 all /force and press Enter. The /nt60 parameter applies the master boot code that is compatible with BOOTMGR. The /all argument updates the master boot code on all partitions. The /force parameter forcibly dismounts the volume(s) during the boot code update so that the Bootsect.exe tool does not gain exclusive volume access.

Opera Snapshot_2018-01-10_191538_www.digitalcitizen.life

Running all these commands will create a new MBR and tell it to use the correct Windows boot loader in order to load that specific installation from your drive.

Conclusion


As you can from this guide, Bootrec.exe is a very powerful tool for troubleshooting and fixing problems with your Windows computer’s boot records. If you know other ways to fix issues with your boot records, don’t hesitate to share them in a comment.

 

 

 

Command Prompt – The Most Powerful & Least Used Windows Tool

by Codrut Neagu published on 12/06/2010. digitalcitizen . life

At the beginning of 2010, we started a series on system recovery tools for Windows 7. Little did we know that the series would expand tremendously and, in the end, we would cover quite extensively a very old and misunderstood tool: the Command Prompt. While working with it, we were fortunate to truly learn its power and usefulness. Therefore, we would like to end our series of articles with a recap about all the great things the Command Prompt can do.

The Basics about the Command Prompt


If you have not used the Command Prompt much, it is best to start with the basics. In our article about How to Customize the Command Prompt you will learn where to find this tool and how to start it and customize it. You might not think of your Command Prompt as something cute and colourful, right? Think again. Go through this tutorial and experiment with all the configuration options. The Command Prompt can be cute and pink too, right along with the newer, sexier Windows 7 tools such as Desktop Gadgets.

Before you run any command, it is best to learn how to run the Command Prompt in Administrator ‘mode’. Many of its powers require administrator privileges in order to work.

In Command Prompt – How to Use Basic Commands  we have covered the most basic and yet useful commands. You will learn how to navigate through partitions, files and folder structures and how to work with them. Also, you will learn how to launch other applications or how to get help while working in the Command Prompt.

Getting into Command Prompt’s Advanced Powers


Now that you’ve got your basics right, it’s time to fine-tune your ninja computing skills and learn some of the advanced commands you can run inside the Command Prompt:

  • Command Prompt – Advanced Disk Management Commands – To complete the list of file and folder management commands listed in the basic guide, we’ve got more advanced stuff about how you can manage your partitions directly from the Command Prompt. You will learn how to create, modify or delete partitions with a few simple commands.
  • Command Prompt – Advanced Commands for System Information & Managing Active Tasks – Do you want to know all currently running processes? Do you have an unresponsive application which you want to kill? Do you want complete system information by typing only one short command? This tutorial has the answers for you.
  • Command Prompt – Advanced Networking Commands – If you want to be the ultimate geek, you need to learn a bit about networking and how to run some networking tasks in the Command Prompt. This tutorial covers useful commands which help you retrieve information about your network connections and MAC address; and test and display information about active connections.

Repair Your Computer from the Command Prompt


The ultimate power users (such as geeks :)) are able to utilize the Command Prompt also for repairing broken computers and Windows operating systems. For them we’ve got the following tutorials:

Conclusion


Our series on the Command Prompt tool is far from being complete. We did not manage to cover all the commands you can run. What we tried to do was to simply give you a taste of what this powerful tool can do for you and hopefully raise your interest in learning more about it. Do let us know if we’ve succeeded. Also, if you’ve got some other cool tips and commands to share, don’t hesitate to leave a comment. We might decide to continue the series.

 

Command Prompt – 6 Disk Management Commands you should know

by Codrut Neagu published on 06/21/2016. digitalcitizen . life

One of the easiest and most straightforward ways to manage your disks is to use the Disk Management tool from Windows. But hey, Disk Management is a visual tool and some of us like command based interfaces a whole lot more. That’s why we thought it would be a great idea to see how several disk management actions can be done from the Command Prompt , using DiskPart and other command-line tools . In this article you will learn how to create, format, delete, defragment and check your partitions for errors, directly from the Command Prompt . Let’s get started:

Important aspects to consider before moving forward


In order to perform any action presented in this article, you need to have administrative permissions and run the Command Prompt as administrator. Check ou t 7 Ways To Run Programs As Administrator In Windows to see how to run Command Prom pt as administrator.

It’s also very important for you to acknowledge the fact that, if you misuse the commands listed in this article, you risk losing your data. Be careful and make a backup of your data before going ahead. If anything bad should happen, don’t say we didn’t warn you! 🙂

1. How to create a partition from Command Prompt


First of all, open the Command Prompt. Then, type diskpart to access the Windows tool called Diskpart .

cmd_0

After you’ve launched diskpart it’s time to establish which hard drive or solid state drive will be used to create a new partition. You will select the drive by using the select command. To view the available disks on your system, use the command list disk.

cmd_1

To select the disk you want to work with, type select disk followed by the number of the hard disk you want to use.

cmd_2

To create a new partition, you need to use the create partition command followed by the partition type and size. Note that the list command used previously also displays the available free space on each hard disk. Your partition must be of a size equal or less to the amount of available free space.

For instance, in order to make a new primary partition with the size of 1000 MB, you should type “create partition primary size=1000” . Use the same command and change the size according to your needs and the available free space on your hard disk.

cmd_3

2. How to assign a letter to a partition from Command Prompt


You can and will probably want to also assign a letter to the newly created volume. Assigning a letter to a partition makes it visible in File Explorer , so that you can easily access it. To assign a letter to a partition directly from Command Prompt , use the assign command.

For instance, if you wanted to assign the R letter to the partition you just created, you should type “assign letter = R” .

cmd_4

Please remember that before assigning a drive letter, you need to start Diskpart and select the disk for which you want to assign the letter.

3. How to format a partition from Command Prompt


Although you now have a new partition created on your computer or device and it also has a letter assigned so it’s easy to access it, you are still unable to use it until you also format that partition. To do that too, use the command “format fs=ntfs quick” . Use help format to find out more information about this command.

cmd_5

This command should be used after you start Diskpart and select the disk that you want to format.

When you are done working with diskpart , type the exit command to close the program.

cmd_6

4 . How to delete a partition from Command Prompt


When you need to delete a drive from your computer, the procedure is quite simple. First, open the diskpart application. Then, select the partition that you want to delete and type the delete partition command. You can see an example of how the delete operation works, below. It is a matter of selecting the disk where the partition is found, then selecting the volume to be deleted and running the delete command.

cmd_7

5 . How to check a disk for errors from the Command Prompt


To check a disk for errors you have to use the chkdsk command. Type chkdsk followed by the drive’s letter. We recommend that you always use this command in combination with the /f parameter. This enables the tool to automatically fix any errors it finds.

As an example, we will scan the R : drive for errors by typing chkdsk /f r: and pressing Enter . The scan process will start.

cmd_8

After the scan is finished you see a report similar to the one from the picture below.

cmd_9

This summarizes how much disk space the partition has, how many files are in use by the system, how much free space is available on the disk, how many bad sectors were identified and so on.

6 . How to defragment a disk from the Command Prompt


The Command Prompt also gives you a way of defragmenting a partition. All you have to do is type the command defrag followed by the drive’s letter. If you wanted to defragment the R: partition, for example, you would use “defrag r:”. If everything worked well, you should get a report like the one below, after the volume you selected has been defragmented.

cmd_10

The report includes information prior to the optimization process and after it was completed, like the volume size, free space, total fragmented space and the largest free space size.

Conclusion


Despite the fact that you might think it’s hard to manage your partitions through the Command Prompt , we hope that we managed to prove that it’s not that difficult. The procedures involved are not complicated at all and, once you know the correct commands, using the Command Prompt can be a lot faster than using other tools like Disk Management . If you have any questions, feel free to leave a comment below.

 

 

How To Make The Command Prompt Look & Work Better

by Codrut Neagu published on 09/14/2015. digitalcitizen . life

We like the Command Prompt and we are not alone in that. But, even though it is a mighty and powerful tool, it sure looks boring. What if you want to make it prettier? And what about customizing certain things about the way it works, like how many commands it stores in its history? To learn all this and more, read this tutorial.

NOTE: This article applies for Windows 7, Windows 8.1 and Windows 10.

What Is The Command Prompt?


Before Windows was created, the most used operating system was DOS (Disk Operating System). It was a text-based operating system, that allowed you to run programs by manually typing in commands.

The launch of the Windows operating system simplified the whole computing experience by making it more visual. Even though DOS is no longer included in Windows operating systems since Windows ME (in 2000), we still have the Command Prompt – the text command-line interpreter, analog of the command shell found in the old DOS operating system.

This tool is generally used by geeks and more advanced users, such as system administrators. With it, you can run all kinds of commands. You can manage your partitions, network devices and connections or you can simply run programs and executable files.

Most probably, the Command Prompt will be phased out and, in the future, Windows users will have to learn and use PowerShell if they want to use a powerful command line interpreter. But, for now, let’s see how to launch Command Prompt and how to make it look pretty. It is not as un-customizable as you would think.

How To Start The Command Prompt


This has been shown in detail, in this tutorial: 7 Ways to Launch the Command Prompt in Windows.

When you first open the Command Prompt it opens at your user folder: “C:\Users\Your user name”.

Opera Snapshot_2018-01-10_091650_www.digitalcitizen.life

When you run it as administrator, it opens at the default system folder: “C:\Windows\system32”.

Opera Snapshot_2018-01-10_091836_www.digitalcitizen.life

How To Access The Properties Of The Command Prompt


If you want to customize the way Command Prompt looks and works, you need to access its Propertieswindow. Right click or long press on the top of the Command Prompt window and select Properties.

Opera Snapshot_2018-01-10_092004_www.digitalcitizen.life

You will notice four tabs with options that can be configured in detail: Options, Font, Layout and Colors.

Opera Snapshot_2018-01-10_092116_www.digitalcitizen.life.png

Let’s take a look at these tabs and see what they offer in terms of customization options.

How To Customize The Command Prompt Cursor Size, Buffers And Edit Modes


The first tab is named Options. In Windows 7 and in Windows 8.1, it includes three sections: Cursor Size, Command History and Edit Options.

Opera Snapshot_2018-01-10_092418_www.digitalcitizen.life

In Windows 10, besides the Cursor Size, Command History and Edit Options section, you’ll also find two additional sections for Text Selection and Current code page, and an additional option called Use legacy console.

Opera Snapshot_2018-01-10_092547_www.digitalcitizen.life

Regardless of the operating system you use, the first section – Cursor Size – is about changing the size of the cursor. You can choose one of the available options: Small, Medium or Large.

In the Command History section you can customize how many commands are retained in the command buffer. The buffer serves as a historical record of the commands you have executed. Use the Up and Downarrow keys to navigate through the previously entered commands.

The default value is 50 commands but it can be made as large as 999. The next option, “Number of Buffers”determines for how many concurrent instances of the Command Prompt you’re using separate buffers. For example if you change the value to three, you will be able to have up to three Command Prompt instances opened, each with its own buffer. The last option from this section, “Discard Old Duplicates”, allows Windows to remove duplicate command entries from the buffer.

Both in Windows 7, Windows 8.1 and in Windows 10, the Edit Options section offers options for QuickEdit Mode and Insert Mode. The first one allows you to use the mouse to cut and paste text to and from the Command Prompt window. The second – Insert Mode – has the same function as the Insert keyboard key: the cursor inserts a character at its current position, forcing all characters past it one position further. If Insert Mode is disabled, then when you type, what you’re typing overwrites any text that is present in your current location.

A sample of how QuickEdit Mode works can be viewed in the capture below. With the mouse, we selected the text for copying. We then pressed Enter and the text was copied to the clipboard.

Opera Snapshot_2018-01-10_092708_www.digitalcitizen.life

You can then paste the selected text in any other program.

If you’re using Windows 10, the Edit Options section offers two more options for you to use: Enable Ctrl key shortcuts and Filter clipboard contents on paste. However, in order to be able to use these (and other) new options, you first have to uncheck the last feature from the Options tab: Use legacy console.

Opera Snapshot_2018-01-10_092830_www.digitalcitizen.life

Once you’ve unchecked Use legacy console and relaunched Command Prompt, all the new features brought by Windows 10’s Command Prompt can be enabled.

Let’s go back to the Edit Options section from Windows 10’s Command Prompt. If you Enable Ctrl key shortcuts, Command Prompt will let you use a set of keyboard shortcuts like Ctrl + C or Ctrl + V inside it, which is something you couldn’t do in previous versions. We promise we’ll talk about all the new keyboard shortcuts you can use in Windows 10’s Command Prompt in a very soon to come tutorial.

The last option from the Edit Options section of Windows 10’s Command Prompt is called Filter clipboard contents on paste. If you enable it, whenever you paste content from the clipboard inside Command Prompt, tabs are automatically removed and smart quotes are converted to regular ones.

Going further, Windows 10’s Command Prompt includes a new section called Text Selection. Here, you have two options which you can set: Enable line wrapping selection and Extended text selection keys.

Enabling line wrapping selection enhances the way in which Command Prompt handles text selection. Previous versions of Command Prompt only allowed copying text from it in block mode. That meant that each time you pasted content from Command Prompt in a text editor you had to manually correct tabs, word wrapping etc. If you enable this option, Windows 10 takes care of all that, so you won’t have to correct the flow of text anymore.

If you enable Extended text selection keys, Windows 10’s Command Prompt will allow you to use a set of common keyboard shortcuts inside it. For example, you can use Shift + Arrow keys to select text.

Opera Snapshot_2018-01-10_092952_www.digitalcitizen.life

Current code page is also a new section from Windows 10’s Command Prompt. This section doesn’t include any options for you to set: it only informs you about the character code you use.

How To Adjust The Font Used By The Command Prompt


In the Font tab you can select the size and Font used by the Command Prompt window. Also, you can use the window preview to see the effect of your settings before applying them.

Opera Snapshot_2018-01-10_093125_www.digitalcitizen.life

The Size list displays several values for how large each character is. Then, in the Font list you can select one of the three available fonts.

How to Change the Command Prompt Window Layout & Size


The Layout tab has three sections where you can configure the size of the Command Prompt window. The available options are as follows:

  • Screen Buffer Size – use it to configure how many characters are displayed on a line in the Command Prompt window, by adjusting the Width value. The number of lines that are stored in memory, are adjusted using Height value;
  • Window Size – use it to select the Width and Height of the Command Prompt window;
  • Window Position – enables you to configure the Command Prompt’s window distance from the left and top edges of the screen. This can be done only if the “Let System Position Window” box is not checked;
  • Let System Position Window – if it’s checked, you won’t be able to configure the window position settings but you can drag and drop, or resize the Command Prompt window with the mouse. 

Opera Snapshot_2018-01-10_093321_www.digitalcitizen.life

Next, let’s take a look at the final tab.

How To Set The Window Colors For The Command Prompt


The Colors tab is all about customizing the colors used by the Command Prompt. There are four items that can be customized:

  • Screen Text – use it to set the color of the text, in the Command Prompt window;
  • Screen Background – use it to choose the background color of the Command Prompt window;
  • Popup Text – use it to set the color of the text displayed in pop-up windows triggered by the Command Prompt;
  • Popup Background – use it to set the background color of the pop-up windows triggered by the Command Prompt.

Opera Snapshot_2018-01-10_093557_www.digitalcitizen.life

If you’re using Windows 10, Command Prompt also lets you set its transparency. Underneath all the sections from its Colors tab, you’ll find a section called Opacity. Moving the slider from this section will let you change the transparency of the Command Prompt to the level you want. Note however, that this option is only available if you unchecked the Use legacy console setting from the Options tab.

Opera Snapshot_2018-01-10_093720_www.digitalcitizen.life

When you are done changing your settings, all that remains to do is for you to click or tap OK to apply them.

Conclusion


As you can see from this guide, there are plenty of customization options that allow you to make the Command Prompt friendlier than it seems at first sight. If you are looking for other useful tips about the Command Prompt, don’t hesitate to read the articles recommended below.

Command Prompt – Four Networking Commands you should know

by Codrut Neagu published on 05/25/2016. digitalcitizen . life

In one of our previous tutorials, you learned how to use basic commands in Command Prompt . Now it’s time to take things to the next level and see how to use some of the more advanced commands. Today, we’re going to take a close look at some very useful network commands. We will learn about things like how to view information about network devices and connections or how to check the availability of a network host or internet website. For all this, and more, read this tutorial:

NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1 and Windows 7. For simplicity, we will use screenshots taken in Windows 10.

1. Retrieving information about your network connections


To obtain detailed information about your network connection, use the ipconfig command. Open Command Prompt , type ipconfig and press Enter . As you can see in the screenshot below, when you run this command, Windows displays a list with all the network devices found on your system and their IP addresses. You also get details like the default gateway, subnet mask or the state of the network adapter.

cmd_networking_0

If you add the /all switch to the ipconfig command, you can get to a whole new level of detail: DNS information, the MAC (Media Access Control) (in the Physical Address field) and other information about each network component. Check out the picture below to see a sample of what you’ll get from the “ipconfig /all” command .

cmd_networking_1

It’s worth mentioning that the ipconfig command also allows you to perform some other operations, if you use the right parameter. For example, the “ipconfig /release” and “ipconfig /renew” commands force your network adapter to drop and renew the current IP address.

The release and renew parameters are useful in networks that use DHCP (Dynamic Host Configuration Protocol) to distribute IP addresses automatically. Basically, your system gives up its current address and requests a new one from the DHCP server, and that can help you troubleshoot certain network issues.

2. Finding your network adapter’s MAC addresses


Another way to obtain the MAC addresses of your network adapters is to use the getmac command. In Command Prompt , type getmac and press Enter , like in the image below.

cmd_networking_2

3. Testing the connection to a website or to a network location


To test your connection to a certain website or another network or internet location, you can use the ping network command, followed by a web address or IP address. For instance, if you want to check the connectivity to Digital Citizen , without opening a web browser, type the command “ping www . digitalcitizen . life“ and then press the Enter key on your keyboard .

cmd_networking_3

The ping command also allows you to use the very useful “-t” parameter, which enables you to ping the specified address forever until it’s manually stopped.

For instance, we typed “ping -t www dot digitalcitizen dot life” . After some time, we wanted to see some connection statistics and we used the keyboard combination “CRTL + Break” . This shows the averages of the ping commands run until then.

Finally, we terminated the command by using the keyboard combination “CTRL + C” . This stops the endless cycle of ping commands to the specified address.

cmd_networking_4

4. Check your computer’s network connections and open ports


The netstat command lets you see the network connections that are active between your system and any other systems on your network or the internet.

cmd_networking_5

If you add the -a parameter to the netstat command, you can get a list with all the connections and listening ports, like in the image below.

cmd_networking_6

Conclusion


The networking commands that you can run in the Command Prompt can be useful when you need to find information about devices connected to your network or when you want to test your network connections state . They’re also very useful when you have networking issues and you’re trying to troubleshoot them by yourself. If you have any questions about the networking commands, or if you need help with any of them, don’t hesitate to leave us a comment below