9 Command Prompt Commands You Should Know!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys I'm Theo Joe and today we're taking a look at the good old command prompt in Windows specifically we've got nine useful interesting or just plain cool commands that are worth knowing about and I think you'll like these before we jump in I want to let you know about today's sponsor BitDefender and their latest product BitDefender total security 20/20 more than just an antivirus it's a complete security suite covering all major platforms namely Windows Mac iOS and Android it's highly rated by independent labs and one product of the year from av-comparatives and won best protection and best performance from AV tests we can go into more details about all the features a little later but be sure to check out the link in the description where you can get a special extended four month free trial for new users in the US and Canada which will cover up to five of your devices and with having said that let's get into those command prompt commands alright so hopefully you already know how to get to the command prompt you can just search CMD + the Start menu and you can run it either regularly or some commands on here might require to run as an administrator the first command is a really cool one you've probably never heard of before called safer this allows you to encrypt and decrypt files and folders on your computer and also securely erase files in free space the command can be used on a new folder that's empty by typing cipher and then /e to encrypt or slash D to decrypt and then the path of the thing you want to encrypt so we can create a folder just called folder in this example now automatically any files you put into that folder will be encrypted on the fly and you'll see a little padlock on the icon to show that it's encrypted if you want to encrypt a directory that already has files in it you need to do it like this do you type cipher /e / s : and then the directory and that will encrypt everything inside it currently and going forward now the encryption key is tied to your user account so it's not like you set a password or anything it just automatically loads the key when you log on so if you are not logged on or the computer or if the computer is off then the files will remain encrypted and inaccessible after you encrypt a folder you'll get a notification or to back up the encryption keys which you should definitely do maybe to a thumb drive or something because if you ever have to copy those files off the computer during a recovery when not logged in you will need the key file to decrypt them later you can also probably backup the certificates by searching manage security certificates in Start menu and then going through that process another use of the cipher command is to overwrite any free space on a drive ensuring that no deleted files can be recovered because if you didn't realize when you delete a file even from the recycle bin the file isn't exactly erased right away it's just marked as free space and the file can be potentially recovered until the sector on the hard drive is used to overwrite something else so the command we would use here is the following its cipher slash W : and then the drive letter with no spaces in the second part it will then just overwrite that empty space on the drive by basically writing a huge temporary file and if you keep refreshing Explorer you can see that it keeps getting bigger overriding any free space and then it just deletes itself when it's finished alright so moving on the next command is IP config this is a very useful command you might already know about but basically displays information about all of your network adapters such as the local IP address of the adapter and if you type in ipconfig /all it shows even more detailed info including the MAC address aka the physical address of each adapter which is a unique identifier and useful for identifying unknown devices sometimes then another parameter is IP config slash flush DNS which purges the DNS cache resolver which is basically just the saved list of which IP addresses correspond to which websites sometimes this can be useful if you're having trouble accessing certain websites or they're misbehaving in some way or you've changed around your network settings on your local network it can't hurt and might come in handy if you can try it ok on to number 3 we have two commands that will just combine into one and these are ping and tracer the ping command is very simple you just type ping and then the domain name or IP address and your computer will send out a packet asking for a response if there is a response you'll see how long each one took we'll also show the IP address associated with the domain so if you are wondering what IP address a certain website has this is a way to find out though keep in mind for big websites like Google the IP address might change because they have different servers distributing the load at different times and the ping command is also useful if you're having trouble accessing a certain website you can try pinging it to see if it even responds now the other similar command is called tray cert which is kind of like ping except it shows every single hop your connection makes on the way to its final connection obviously when you connect to a website using the Internet the data isn't a straight shot to the website servers it must first go to your ISP which might relay it to another place or several before finally reaching the website running tracer followed by the domain will show you each of those intermediate connections along with the average latency up to that point though this will take a bit longer than the ping command to finish so this command can be potentially useful if you're diagnosing a misbehaving internet connection because you can see exactly where there are any issues for example if you have no internet connection at all you can run tracer on some website and see if the connection even makes it past your router which would suggest a problem with your local network not your ISP okay next up we have a nifty little command called FC which stands for a file compare you can run it by typing FC then the location of one file and another and in this example I'm already in the directory with the file so I don't need to put the whole path and then like the name suggests it will tell you if the files are exactly the same or not and if they are text-based files what those differences are so in my example I have a dot txt and B dot txt which are both empty and it says there are no differences so if I add some text to B dot txt and whatever to a dot txt it will now show those as differences now this will technically work for any kind of file even images and rich text files like ms word doc x-files but those exact differences won't be recognizable because it's not just pure text so really in most cases it's just good for determining if a file is exactly the same as another alright now before we continue to the rest of the commands which are especially useful let me tell you about a sponsor like I mentioned before BitDefender total security 20/20 has a wide array of features such as a network threat prevention which can stop attacks before they begin by blocking malicious attempts on system vulnerabilities and brute-force attacks plus there's advanced threat defense which detects suspicious processes based on their behavior it also has multi-layer ransomware protection which keeps your important files safe even from the most advanced ransomware attacks this includes ransomware remediation which basically instantly backs up any files it detects is trying to be encrypted by ransomware and restores it after that malware is blocked and on top of all that there's even a VPN included for securing your internet connection through an encrypted tunnel with that you get 200 megabytes per day per device of bandwidth but it is upgradeable to premium so again be sure to check out the link in the description for an extended four month free trial if you're a new user based in the US or Canada all right so moving on these next two commands I'll also combine in one but they're both very important commands they are the SFC or a system file checker command and the dism command which is short for deployment image servicing and management' complicated names aside what these tools do is check the integrity of Windows core system files and repairs them if it finds any errors they're invaluable if you're ever having problems with Windows and suspect corrupted system files so to use them you'll probably need to run CMD as administrator and the first command you'd run is SFC space slash scan now which will check for damage system files and automatically attempt to repair them after it's done ideally you'll see a message that it did not find any integrity violations which just means it found no issues if it did find errors it may or may not succeed in fixing them automatically and just by chance when I was recording this it did actually find corrupted files and fortunately it says it successfully repaired them if it fails to repair don't worry we're not done yet we still have to do the other command so let it try and in either case whether it found errors and fix them or it didn't find any errors you should restart the computer before continuing to the next command just in case so then after restarting you can do the following command which is dism slash online slash cleanup - image slash restore health and I'll put that in the description by the way so you can just copy and paste it this command will also check and repair some different system files and oftentimes it will actually repair files that the SFC command needs to repair its files so after it finishes hopefully it should say there is no corruption detected but if it does hopefully it will fix anything and then after this process completes you should again restart the computer and then run sfc /scannow again because the dism command may have repaired files that will now allow the system file checker to repair any files it failed to before and hopefully by the end of all that everything will be fixed ok on to number 6 we have another classic and essential command which is check disk or chkdsk this one is easily one of the most important commands of them all and it finds and attempts to repair any disk errors the typical way to run this command is to type check disk and then whatever drive letter you want to check probably the C Drive so C colon and then slash are the /r parameter tells the tool to check for both disk errors and bad sectors and try to repair them both in most cases it will probably tell you that the command will require a restart to run especially if it's the system drive because it will have to run the program when the drive is not in use even if it's a secondary drive though you probably don't want to force dismount it if it's in use so you can just schedule that to restart - so just restart the computer and it will do its thing on startup and I just ran it on a thumb drive though so it doesn't matter and then you can just let it go and hopefully it won't find anything or at least fix any issues it does find on the thumb drive for example here you can see that it found no errors up to number seven we have two commands that go hand-in-hand which are the task list and task kill commands you can probably figure out what these do just by the names task list will show a list of processes running on the computer just like what the task manager already does and it will also show the process ID of each under the PID column though you can also have the process ID show and task manager by right-clicking to add that so nothing here so far is very unique and obviously you can also use the task manager to kill processes by hitting Enter but sometimes even that doesn't work and the process just keeps going in that case the task kill command may work instead what you do is type tasks kill then /f + /t and then either /am with the name of the process or /p ID with the process ID know the /f parameter is to forcefully terminate the process and the slash T parameter also terminates any child processes started by the one you're terminating which is sometimes a reason task manager is unable to end one just be sure to run CMD is admin but task kill should hopefully work if task manager fails and if not you might just need to do the unthinkable and restart the computer okay up to number eight we got a couple more so now we come to the power CFG command or power config specifically we'll look at the slash energy and slash battery report parameters for this command which both generate potentially interesting reports about your computer's power usage so the first one power CFG slash energy when you run it will observe the system's power consumption for 60 seconds and then generate an HTML report file in its current path which it will show and this report will let you know about any potential errors related to system power though in my case it's mostly just a bunch of notices about USB devices not going to sleep which I don't really care about it's probably going to seem like information overload so I've just considered this more of a curiosity unless you actually are having power issues with your computer the other parameter can be used by running power CFG / battery report and this generates a similar report but specifically having to do with the battery assuming your computer has one I tried running it on my desktop which does not have a battery obviously and it's spat out an error but if it does work for you the report apparently looks pretty cool giving you info like full charge capacity a graph of battery usage stuff like that which might be worth looking at alright finally number 9 we have another command which can generate a cool report this time about your Wi-Fi connection it's kind of long but it is net sh w LAN show W LAN report and the report file it creates which can be found in the directory listed will show all sorts of info for example info about Wi-Fi connection sessions any connections or dis connections from Wi-Fi networks and info about the Wi-Fi adapter itself you can also see a graph over time of different events including errors and other states of the Wi-Fi connection near the bottom you'll also notice it ran some other commands that we talked about like IP config and includes that in the report so this report might come in handy if you have been having some weird Wi-Fi connection issues it might shine some light on what's going on so hopefully these commands should be useful to you at some point in the future I want to give a final thanks to BitDefender for sponsoring this video and again be sure to check that link in the description for that free trial if you guys want to keep watching the next video I'd recommend is one with 9 advanced windows features everyone should know and I'll put that right here so you can click on it so thanks so much for watching guys and I'll see you in the next one
Info
Channel: ThioJoe
Views: 627,967
Rating: 4.9137859 out of 5
Keywords: technology, tech, command prompt, windows cmd, cmd, cmd commands, windows command prompt, command prompt commands, best cmd commands, windows terminal, microsoft windows
Id: MR16jVBPz0Y
Channel Id: undefined
Length: 14min 22sec (862 seconds)
Published: Wed Jun 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.