{"id":1137,"date":"2021-11-03T08:42:23","date_gmt":"2021-11-03T08:42:23","guid":{"rendered":"https:\/\/matob.web.id\/news\/?p=1137"},"modified":"2021-11-03T08:51:36","modified_gmt":"2021-11-03T08:51:36","slug":"learn-cmd-commands","status":"publish","type":"post","link":"https:\/\/matob.web.id\/news\/learn-cmd-commands\/","title":{"rendered":"Learn 50 CMD Commands on Microsoft Windows"},"content":{"rendered":"<article>Are you a Windows PC user?\u00a0Are you looking for a collection of\u00a0<a href=\"https:\/\/matob.web.id\/news\/learn-cmd-commands\/\"><strong>Command Prompt (CMD)<\/strong><\/a><a href=\"https:\/\/matob.web.id\/news\/learn-cmd-commands\/\">\u00a0commands<\/a>\u00a0that can make it easier to operate the device?<\/p>\n<p>Although currently all the cool features in\u00a0the Windows operating system\u00a0can be used directly in a beautiful\u00a0<strong>GUI (Graphical User Interface)<\/strong>\u00a0mode\u00a0, in reality CMD still cannot be abandoned by its users.<\/p>\n<p>Whether it&#8217;s to help in the use of basic features, to doing things that are very technical.\u00a0In fact, not a few of them are looking for CMD commands to hack websites.<\/p>\n<p>Well, talking about the Command Prompt command, in this article Matob will give you a collection of CMD commands and their functions that you can try. Come on, take a look!<\/p>\n<h2>What is a CMD Command?<\/h2>\n<p>Command Prompt or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cmd.exe\" target=\"_blank\" rel=\"noopener\">CMD<\/a> is a\u00a0<em>command line interpreter<\/em>\u00a0(CLI) application that exists in the Windows operating system.\u00a0The commands in CMD serve to perform various operations on your computer.<\/p>\n<p>Actually, these commands have been around since the days of MS-DOS.\u00a0However, ordinary Windows users have rarely used the CMD command because the same function is now more easily accessible through the menu.<\/p>\n<p>However, the CMD command gives you more control over the operation of your computer.\u00a0The variety is a lot.\u00a0However, don&#8217;t worry.\u00a0You can use the list in this article as a cheat sheet!<\/p>\n<h2>How to Open CMD \/ Command Prompt<\/h2>\n<p>Here&#8217;s an easy and quick way to open CMD on your computer via a shortcut (Windows\u00a0<em>shortcut)<\/em>\u00a0:<\/p>\n<ol>\n<li>Press\u00a0<strong>Windows<\/strong>\u00a0key\u00a0(window image)\u00a0<strong>+ R<\/strong>\u00a0on your keyboard<\/li>\n<li>Type\u00a0<strong>CMD<\/strong>\u00a0, then press\u00a0<strong>Enter<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1139 aligncenter\" src=\"https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/open-cmd-using-run-program.png\" alt=\"open cmd using run program\" width=\"468\" height=\"288\" title=\"\" srcset=\"https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/open-cmd-using-run-program.png 468w, https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/open-cmd-using-run-program-300x185.png 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/strong><\/li>\n<li>Congratulations!\u00a0The command prompt is open.\u00a0Easy and fast, isn&#8217;t it?<\/li>\n<\/ol>\n<h2>Complete List of CMD Commands and Their Functions<\/h2>\n<p>Before entering into this list of <a href=\"https:\/\/matob.web.id\/news\/learn-cmd-commands\/\">CMD commands<\/a>, you need to know that not all commands can be used in all versions of Windows.\u00a0To know which are the basic CMD commands that you can use, see the explanation below.<\/p>\n<h3>1. append<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions except Windows 10<\/p>\n<p>The\u00a0<strong>append<\/strong>\u00a0command\u00a0allows you to open files that are in another directory, even when you are not in that directory.\u00a0An example of its use is as below:<\/p>\n<pre>append c:\\docs;c:\\letters edit myfile.txt<\/pre>\n<p>The goal with this command is to open and edit a file called myfile.txt.\u00a0If the file is not in the directory you are currently opening, the command will look for it in the c:\\docs and c:\\letters directories.<\/p>\n<p>If you want to add more than one search directory, use a semicolon (;) to separate each directory.<\/p>\n<h3>2. arp<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>As the name implies, the arp command is used to manage ARP or the\u00a0<em>address resolution protocol<\/em>\u00a0.\u00a0ARP itself is part of the IP (\u00a0<em>internet protocol<\/em>\u00a0) that directs a\u00a032-bit\u00a0IP address\u00a0to a MAC (\u00a0<em>medium access control<\/em>\u00a0) address.<\/p>\n<p>Here is an example of using the arp command.\u00a0Let&#8217;s say your IP address is 220.0.0.160.\u00a0If you want to replace it, just run the following command:<\/p>\n<pre>arp -s 220.0.0.161 00-50-04-62-F7-23<\/pre>\n<p>With this command, your IP address will be replaced with 220.0.0.161.<\/p>\n<h3>3. assoc<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The assoc command is used to check the file extension associated with a file type.\u00a0For example, say you want to display a description of the .txt extension.\u00a0For that, you need to run the following command.<\/p>\n<pre>assoc .txt<\/pre>\n<p>After you enter the command, it will display the words .txt=txtfile, which means .txt is an extension for text files.<\/p>\n<p>In addition, the assoc command can also be used to change or remove the association of a file extension with a file type.\u00a0Here is an example of using it to delete:<\/p>\n<pre>assoc .txt=<\/pre>\n<p>If you want to use the above command, don&#8217;t forget to add a space after the equal sign (=).<\/p>\n<h3>4. at<\/h3>\n<p><strong>Supported on:<\/strong>\u00a0Windows 2000 and XP<\/p>\n<p>The at command is used to automate various other commands at specified times.\u00a0Although it&#8217;s only supported on three older versions of Windows, at actually can also be used on Vista and 7 even though the status is\u00a0<em>deprecated<\/em>\u00a0(no longer getting updates or support).<\/p>\n<p>Starting in Windows 8, at has been replaced with schtasks which has a similar function.\u00a0This command will also be discussed later.<\/p>\n<p>The at command itself has several uses.\u00a0If you just type at, the Command Prompt will display a list of automated commands.<\/p>\n<p>Note that each of these commands is represented by an ID number.\u00a0This number is useful when you want to remove the automation of an already registered command.<\/p>\n<p>For example, the command below will remove the command automation with ID 1:<\/p>\n<pre>at 1 \/delete<\/pre>\n<p>If you want to delete everything, you can type the following command:<\/p>\n<pre>at \/delete \/yes<\/pre>\n<p>Now, let&#8217;s try to automate the command with the following example:<\/p>\n<pre>at 6:50PM \/every:5,10,15,20,25 \"c:\\winnt\\task.bat\"<\/pre>\n<p>In this example, your computer will run the task.bat file automatically at 6:50 p.m. every 5th, 10th, 15th, 20th, and 25th. As a reminder, you can only use the date to specify the day the automation will run.<\/p>\n<p>If \/interactive is added after runtime as in the example below, you&#8217;ll be able to interact with the file when it&#8217;s run.<\/p>\n<pre>at 6:50PM \/interactive \/every:5,10,15,20,25 c:\\winnt\\beep.bat<\/pre>\n<h3>5. attrib<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>Have you ever come across a file you don&#8217;t want, but you can&#8217;t delete?\u00a0Perhaps the file attribute is set to\u00a0<em>read-only<\/em>\u00a0.<\/p>\n<p>To change its attributes, the common way is to right-click on the file, then open Properties.\u00a0At the bottom of the Properties window you will find a checkbox to turn this attribute off or on.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1140 aligncenter\" src=\"https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/attribute-file.png\" alt=\"attribute-file\" width=\"360\" height=\"505\" title=\"\" srcset=\"https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/attribute-file.png 360w, https:\/\/matob.web.id\/news\/wp-content\/uploads\/sites\/4\/2021\/11\/attribute-file-214x300.png 214w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p>However, you can also do this with the attrib CMD command.\u00a0For example, as shown below:<\/p>\n<pre>attrib -R example.txt<\/pre>\n<p>In that example, -R implies removing the\u00a0<em>read-only<\/em>\u00a0attribute\u00a0from the file in question.\u00a0If you want to add an attribute, then the minus sign (-) is replaced with a plus sign (+).<\/p>\n<p>In addition to R, there are three other attributes you can set with the attrib command:<\/p>\n<ul>\n<li>H = hidden, to hide the file and vice versa<\/li>\n<li>S = system, indicates that a file is used for operating system requirements<\/li>\n<li>A = archive, indicates that a file has never been backed up<\/li>\n<\/ul>\n<h3>6. bcdedit<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>bcdedit is a command that allows you to do three things: manage the\u00a0<em>boot configuration<\/em>\u00a0data\u00a0store, save the configuration parameters, and set\u00a0the operating system\u00a0<em>boot<\/em>\u00a0.<\/p>\n<p>The bcdedit command format is actually simple.\u00a0Here&#8217;s an example:<\/p>\n<pre>bcdedit \/command &lt;argument&gt;<\/pre>\n<p>\/command is a sub-command that can be used with bcdedit, while &lt;argument&gt; is the name of the file or directory that is the target of this command.<\/p>\n<p>Well, what makes bcdedit quite complicated is the number of sub-commands it contains.\u00a0Below are some of the sub-commands and their functions:<\/p>\n<ul>\n<li>\/createstore \u2014 create\u00a0<em>a<\/em>\u00a0new\u00a0<em>boot configuration<\/em>\u00a0data store<\/li>\n<li>\/create \u2014 creates a\u00a0new\u00a0<em>entry<\/em>\u00a0in a\u00a0<em>boot configuration<\/em>\u00a0data store<\/li>\n<li>\/deletevalue \u2014 removes an element from\u00a0<em>boot entry<\/em><\/li>\n<li>\/bootdebug \u2014 enable the\u00a0<em>boot debugger<\/em>\u00a0in a\u00a0<em>boot entry<\/em>\u00a0or vice versa<\/li>\n<\/ul>\n<p>To see the full list of bcdedit sub-commands you can run the following command:<\/p>\n<pre>bcdedit \/?<\/pre>\n<p>If you want to know the use of a sub-command, you just add its name after the command, like this:<\/p>\n<pre>bcdedit \/? createstore<\/pre>\n<h3>7. bootsect<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The bootsect command is used to update the\u00a0<em>master boot code<\/em>\u00a0in the hard drive partition.\u00a0Thus, you can change the\u00a0<em>boot sequence manager type<\/em>\u00a0from NTLDR to BOOTMGR and vice versa.<\/p>\n<p>For example, you need the command below to change the\u00a0<em>master boot code<\/em>\u00a0for partition: E on your computer:<\/p>\n<pre>bootsect \/nt52 E:<\/pre>\n<h3>8. break<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>Depending on the setting, the key combination ctrl + C can be used to stop an MS-DOS process.\u00a0For example a\u00a0<em>batch<\/em>\u00a0file\u00a0.<\/p>\n<p>Well, break is the command used to define that setting.\u00a0Examples are as follows:<\/p>\n<pre>break off<\/pre>\n<p>If you run the command, the key combination ctrl + C cannot be used to stop the MS-DOS process.\u00a0If you just want to check this setting, just type \u201cbreak\u201d.<\/p>\n<h3>9. cacls<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The cacls command is used to check or modify the\u00a0<em>access control list<\/em>\u00a0(ACL) of a file.\u00a0ACL itself is a list that contains\u00a0<em>access control entries<\/em>\u00a0(ACE).\u00a0This list is used to determine access to files owned by a user on a computer.<\/p>\n<p>The cacls syntax is quite simple, as you can see below:<\/p>\n<pre>cacls [file name] [sub-command]<\/pre>\n<p>There are several sub-commands cacls that can be used, namely:<\/p>\n<ul>\n<li>\/T \u2014 replaces the ACL of specified files in a directory and all sub-directories in it<\/li>\n<li>\/E \u2014 like the previous sub-command, but serves to change the contents of the ACL<\/li>\n<li>\/G user:perm \u2014 grant\u00a0<em>permissions<\/em>\u00a0to a user<\/li>\n<li>\/R user \u2014 remove\u00a0<em>permissions<\/em>\u00a0from a user<\/li>\n<li>\/P user:perm \u2014 change the\u00a0<em>permissions of<\/em>\u00a0a user<\/li>\n<li>\/D user \u2014 remove file access from a user<\/li>\n<\/ul>\n<p>To populate a perm, there are four codes you can use:<\/p>\n<ul>\n<li>n \u2014 none (no access)<\/li>\n<li>r &#8211; read (opens a file)<\/li>\n<li>w \u2014 write (mengubah file)<\/li>\n<li>f \u2014 full control (full access)<\/li>\n<\/ul>\n<p>For example, the code below is run if you want to grant full access to the user named user1 for the myfile.txt file:<\/p>\n<pre>cacls myfile.txt \/e \/g user1:f<\/pre>\n<p>If you just want to know the ACL of a file, you don&#8217;t need to add a sub-command.<\/p>\n<h3>10. call<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The CMD call command is used to run a\u00a0<em>batch<\/em>\u00a0file\u00a0inside another.\u00a0For example, the command below will run the second.bat file inside\u00a0the running\u00a0<em>batch<\/em>\u00a0file\u00a0:<\/p>\n<pre>call second.bat<\/pre>\n<h3>11. change<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>As the name suggests, the change command is used to change the\u00a0<em>remote desktop<\/em>\u00a0(RD)\u00a0<em>session host server<\/em>\u00a0settings\u00a0for\u00a0<em>logon<\/em>\u00a0status\u00a0, COM\u00a0<em>port mapping<\/em>\u00a0, and installation mode.\u00a0The syntax for each of these uses is different.\u00a0Therefore, we will discuss them one by one.<\/p>\n<h4>change logon<\/h4>\n<p>The change logon command sets the\u00a0<em>logon<\/em>\u00a0status\u00a0in the\u00a0<em>client session<\/em>\u00a0.\u00a0For example, you can allow\u00a0<em>logon<\/em>\u00a0by changing its status to\u00a0<em>enabled<\/em>\u00a0, as below:<\/p>\n<pre>change logon \/enable<\/pre>\n<p>Instead, if you want to prevent\u00a0<em>logonings<\/em>\u00a0, use the following command:<\/p>\n<pre>change logon \/disable<\/pre>\n<p>To simply check the status, run this command:<\/p>\n<pre>change logon \/query<\/pre>\n<h4>change port<\/h4>\n<p>You will need the change port command when you want to change the COM\u00a0<em>port mapping<\/em>\u00a0.\u00a0For example, running the following command will switch COM12 to COM1:<\/p>\n<pre>change port com12=com1<\/pre>\n<h4>change user<\/h4>\n<p>As we mentioned earlier, change user is used to change the installation mode of the RD\u00a0<em>session host server<\/em>\u00a0.\u00a0An example of its use is as follows:<\/p>\n<pre>change user \/execute<\/pre>\n<p>The above command allows\u00a0<em>mapping<\/em>\u00a0the .ini file to the main directory.\u00a0However, this means that you cannot\u00a0<em>install<\/em>\u00a0any application on the RD\u00a0<em>session host server<\/em>\u00a0.\u00a0To allow it, use this command:<\/p>\n<pre>change user \/install<\/pre>\n<h3>12. chdir<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>Want to use <a href=\"https:\/\/matob.web.id\/news\/learn-cmd-commands\/\">CMD commands<\/a> for directory navigation?\u00a0Can!\u00a0You just use chdir.\u00a0With this command, you can return to the previously opened directory with a command like below:<\/p>\n<pre>chdir..<\/pre>\n<p>If the command is executed, the effect will be like when you click the\u00a0<em>back<\/em>\u00a0button\u00a0in File Explorer.<\/p>\n<p>In addition, chdir can also be used to return to the main directory.\u00a0Examples are as follows:<\/p>\n<pre>chdir\\<\/pre>\n<p>With that command, from the C: \\ Windows \\ COMMAND&gt; directory you can jump to C: \\ in an instant.<\/p>\n<p>Interestingly, you can open a directory by simply typing its name.\u00a0For example:<\/p>\n<pre>chdir\\windows\\system32<\/pre>\n<p>By executing that command, the system32 directory is directly accessed.<\/p>\n<p>As a side note, you can also replace chdir with cd.\u00a0Both commands have the same function and syntax.<\/p>\n<h3>13. chkdsk<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>Is your laptop or computer slow?\u00a0As a first check step, you can run the chkdsk command.\u00a0This command serves to check the status of your hard drive.<\/p>\n<p>In addition, chkdsk can also be used to try to repair hard drive errors due to\u00a0<em>bad sectors<\/em>\u00a0.\u00a0Just run the following command:<\/p>\n<pre>chkdsk d: \/r<\/pre>\n<h3>14. chkntfs<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The chkntfs function is related to chkdsk.\u00a0With it, you can instruct the computer to check all the\u00a0<em>hard drive<\/em>\u00a0partitions\u00a0and run chkdsk on the partitions that are considered problematic.\u00a0The command is as follows:<\/p>\n<pre>chkntfs \/d<\/pre>\n<h3>15. cipher<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The cipher command is closely related to the encryption of files and folders on\u00a0NTFS type\u00a0<em>hard drives<\/em>\u00a0.\u00a0There are three main functions that you can take advantage of this CMD command.<\/p>\n<p>First, you can check the encryption status of a file or folder with the command below:<\/p>\n<pre>cipher \/c myfile.txt<\/pre>\n<p>Second, you can encrypt a file or folder by replacing \/c with \/e, as in the following example:<\/p>\n<pre>cipher \/e myfile.txt<\/pre>\n<p>Third, the cipher command allows you to turn off file or folder encryption with the \/d sub-command:<\/p>\n<pre>cipher \/d myfile.txt<\/pre>\n<h3>16. clip<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>The clip command is used when you want to copy the output from a CLI to the\u00a0<em>clipboard<\/em>\u00a0for one reason or another.\u00a0The syntax is also very simple;\u00a0just type clip in the Command Prompt and write the name and file extension you want to copy run.\u00a0Examples like this:<\/p>\n<pre>clip readme.txt<\/pre>\n<h3>17. cls<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>For those of you who use the Command Prompt for various purposes, the cls command is very useful.\u00a0By running this command, you can delete all text in CMD, both what you type and the output.<\/p>\n<p>Like clip, you just type cls to use this command.<\/p>\n<p><strong>also read<\/strong> : <a href=\"https:\/\/matob.web.id\/random\/1001\/create-a-new-folder-using-command-prompt-cmd\/\">how to create folder using cmd<\/a><\/p>\n<h3>18. cmdkey<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>cmdkey is used to create, delete, or view usernames and passwords used to log in to a computer.\u00a0This command is useful if you are the admin user of the computer.<\/p>\n<p>The use is simple.\u00a0If you want to see a list of usernames and passwords belonging to computer users, type:<\/p>\n<pre>cmdkey \/list<\/pre>\n<p>Now let&#8217;s try to register a username and password with the following command:<\/p>\n<pre>cmdkey \/add:server01 \/user:userbaru \/pass:pf90<\/pre>\n<p>With that, you have created access for a user named new user with password pf90 in order to enter server01.<\/p>\n<p>If you want to delete it, just use this command:<\/p>\n<pre>cmdkey \/delete:userbaru<\/pre>\n<p>You can also clear the list of usernames and passwords on a server:<\/p>\n<pre>cmdkey \/delete:server01<\/pre>\n<h3>19. color<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 2000<\/p>\n<p>Tired of the black and white appearance of Command Prompt?\u00a0You can change the color with the color command.\u00a0The syntax is like this:<\/p>\n<pre>color &lt;b&gt;&lt;f&gt;<\/pre>\n<p>&lt;b&gt; determines the background color, while &lt;f&gt; determines the text color.\u00a0To determine the color, you use the numbers 0 to 9. However, you cannot choose the same color.\u00a0Here are the colors you can choose from and the numbers that represent them:<\/p>\n<ul>\n<li>0 black<\/li>\n<li>1 biru<\/li>\n<li>2 green<\/li>\n<li>3 aqua<\/li>\n<li>4 red<\/li>\n<li>5 purple<\/li>\n<li>6 yellow<\/li>\n<li>7 white<\/li>\n<li>8 gray<\/li>\n<li>9 light blue<\/li>\n<\/ul>\n<p>In addition, there are six more colors to choose from.\u00a0However, all six are represented by letters.\u00a0Here&#8217;s the list:<\/p>\n<ul>\n<li>a light green<\/li>\n<li>b aqua young<\/li>\n<li>c pink<\/li>\n<li>d ungu time<\/li>\n<li>e light yellow<\/li>\n<li>f bright white<\/li>\n<\/ul>\n<p>For example, with the following command the Command Prompt background will turn gray with red text:<\/p>\n<pre>color 84<\/pre>\n<p>If you want to return the Command Prompt to its original color, just type color without any additions.<\/p>\n<h3>20. comp<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The comp command is used to compare two files.\u00a0Usually, this CMD command is used when you want to check the code of the two files.\u00a0Examples are as follows:<\/p>\n<pre>comp file1.txt file2.txt \/n=10 \/a<\/pre>\n<p>With the above command, you compare file1.txt and file2.txt.<\/p>\n<p>\/n specifies the number of lines of code to be checked with the comp command.\u00a0In that example we compared the first ten lines of code, but you can change it however you want.<\/p>\n<p>\/a is used to display the output of the comp command in the ASCII character set.\u00a0The results are as follows:<\/p>\n<pre>Compare error at LINE 5<\/pre>\n<pre>file1 = i<\/pre>\n<pre>file2 = o<\/pre>\n<pre>Compare error at LINE 5<\/pre>\n<pre>file1 = v<\/pre>\n<pre>file2 = u<\/pre>\n<pre>Compare error at LINE 5<\/pre>\n<pre>file1 = e<\/pre>\n<pre>file2 = r<\/pre>\n<pre>Compare error at LINE 6<\/pre>\n<pre>file1 = s<\/pre>\n<pre>file2 = f<\/pre>\n<pre>Compare error at LINE 6<\/pre>\n<pre>file1 = x<\/pre>\n<pre>file2 = v<\/pre>\n<pre>Compare error at LINE 6<\/pre>\n<pre>file1 =<\/pre>\n<pre>file2 = e<\/pre>\n<pre>Compare error at LINE 7<\/pre>\n<pre>file1 =<\/pre>\n<pre>file2 =<\/pre>\n<pre>Compare error at LINE 7<\/pre>\n<pre>file1 =<\/pre>\n<pre>file2 =<\/pre>\n<pre>Compare error at LINE 8<\/pre>\n<pre>file1 =<\/pre>\n<pre>file2 = s<\/pre>\n<pre>File1 only has 7 lines<\/pre>\n<h3>21. compact<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 2000<\/p>\n<p>Earlier you have studied file encryption with ciphers.\u00a0Now we will discuss the command used to compress files, namely compact.\u00a0However, you need to remember that this command can only work on <a href=\"https:\/\/www.diskpart.com\/articles\/partition-ntfs-hard-drive-0310.html\" target=\"_blank\" rel=\"noopener\">NTFS type partitions<\/a>.<\/p>\n<p>For starters, perhaps you want to check the compression status of each file in a directory.\u00a0The following sample command allows you to check all files in the currently accessed directory:<\/p>\n<pre>compact<\/pre>\n<p>If there is a file you want to compress, the command is something like this:<\/p>\n<pre>compact file.txt \/c<\/pre>\n<p>For the opposite, you just replace \/c with \/u.\u00a0For the record, compressing or decompressing a file will mark the directory in which it is stored.\u00a0Once marked, all files stored in that directory will be compressed or decompressed.<\/p>\n<h3>22. convert<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>As the name implies, the convert command is used when you want to convert a FAT partition to NTFS.\u00a0For example like the following example:<\/p>\n<pre>convert d: \/fs:ntfs<\/pre>\n<h3>23. copy<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The use of the copy command is the same as its name, which is to copy a file to a different location.\u00a0To understand its use, consider the example below:<\/p>\n<pre>copy myfile.txt d:\\<\/pre>\n<p>The command prompts the copying of the file myfile.txt which is in the directory you are currently accessing to the D: directory.<\/p>\n<p>You can also use the copy command to copy all files of the same type.\u00a0To do this, use an asterisk (*) as in this example:<\/p>\n<pre>copy *.txt d:\\<\/pre>\n<p>In fact, the copy command can also be used to copy all files in one directory, as in the following example:<\/p>\n<pre>copy *.* f:\\<\/pre>\n<p>Of course, this command is useful if you want to copy files to a\u00a0<em>removable drive<\/em>\u00a0such as a flash drive.<\/p>\n<p><strong>also read<\/strong> : <a href=\"https:\/\/matob.web.id\/random\/software\/how-to-delete-files-and-folders-using-command-prompt-cmd\/\">how to delete file and folder using cmd<\/a><\/p>\n<h3>24. date<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The date command is used to view the date or change it.\u00a0The syntax is very simple.\u00a0After typing \u201cdate\u201d, the Command Prompt will display today&#8217;s date and a question to change the date.\u00a0If you don&#8217;t want to change it, all you have to do is press the enter key on the keyboard.<\/p>\n<h3>25. defrag<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>If you are diligent in doing\u00a0<em>hard drive<\/em>\u00a0optimization\u00a0, perhaps you are already familiar with the Disk Defragmentation feature.\u00a0You can also do this in the Command Prompt with the CMD defrag command.<\/p>\n<p>To simply do\u00a0<em>defragmentation<\/em>\u00a0, you\u00a0just need to\u00a0run this command:<\/p>\n<pre>defrag c:<\/pre>\n<p>If you want to analyze the partition first, add \/a as in the following example:<\/p>\n<pre>defrag c: \/a<\/pre>\n<pre>In addition, you can also <em>defragment<\/em> all partitions:<\/pre>\n<pre>defrag \/c<\/pre>\n<h3>26. of<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>You can use Command Prompt to delete files with the command del.\u00a0Let&#8217;s look at the following examples to understand their usage.<\/p>\n<p>To delete a file from the currently accessed directory, use the following command:<\/p>\n<pre>del myfile.txt<\/pre>\n<p>Files deleted with this command will go to the Recycle Bin as usual.\u00a0However, you may want to display a confirmation question before the selected file is actually deleted.\u00a0If so, add \/p as in the example below:<\/p>\n<pre>del myfile.txt \/p<\/pre>\n<p>Do you have to access the directory of the file you want to delete?\u00a0Of course not.\u00a0You can do it from another directory with this command:<\/p>\n<pre>del c:\\windows\\test.tmp<\/pre>\n<p>You can even delete entire files in a directory with the following command:<\/p>\n<pre>del c:\\windows\\temp\\*.*<\/pre>\n<p>Interestingly, the del command gives you an ability you can&#8217;t have using File Explorer, namely deleting files with the\u00a0<em>read only<\/em>\u00a0attribute\u00a0.\u00a0You do this by adding \/f after the filename:<\/p>\n<pre>del myfile.txt \/f<\/pre>\n<p>As a reminder, you can replace the del command with delete or erase because all three have the same function.<\/p>\n<h3>27. deltree<\/h3>\n<p><strong>Supported on:<\/strong>\u00a0Windows 95, 98, and ME<\/p>\n<p>If the files deleted with the del, delete, and erase commands go into the Recycle Bin, it is different with the deltree command.\u00a0This command serves to delete files permanently.\u00a0Not only that, deltree can also delete all sub-directories in a directory.<\/p>\n<p>An example of its use is as follows:<\/p>\n<pre>deltree d:\\pictures<\/pre>\n<p>With the above command, the directory named pictures on partition D: and all of its sub-directories will be permanently deleted.<\/p>\n<h3>28. you<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The dir command is useful for viewing a list of files and sub-directories in a directory.\u00a0In addition, this command is also used to display various information about your\u00a0<em>hard drive<\/em>\u00a0, including:<\/p>\n<ul>\n<li>Serial number<\/li>\n<li>Number of files on the\u00a0<em>hard drive<\/em><\/li>\n<li>Total file size<\/li>\n<li>Remaining space on\u00a0<em>hard drive<\/em><\/li>\n<\/ul>\n<p>Let&#8217;s discuss the syntax for each function.\u00a0If you just want to display a list of files and sub-directories in the currently accessed directory, type &#8220;dir&#8221;.<\/p>\n<p>This command can be made more flexible to show only files with certain extensions, as in the following example:<\/p>\n<pre>dir *.txt *.doc<\/pre>\n<p>With the above command, Command Prompt will only show .txt and .doc files in your directory.<\/p>\n<p>The use of the dir command is also inseparable from the file attribute.\u00a0The following is a list of attributes and their symbols in the dir command syntax:<\/p>\n<ul>\n<li>d &#8211; directory<\/li>\n<li>r \u2014 file\u00a0<em>read only<\/em><\/li>\n<li>h \u2014 hidden files (\u00a0<em>hidden<\/em>\u00a0)<\/li>\n<li>a \u2014 files that have not been\u00a0<em>archived<\/em>\u00a0or backed up<\/li>\n<li>s \u2014 file sistem<\/li>\n<li>i \u2014 unindexed files<\/li>\n<\/ul>\n<p>Examples of its use are as follows:<\/p>\n<pre>dir \/ a: r<\/pre>\n<p>With the above command, only files with the\u00a0<em>read only<\/em>\u00a0attribute will be shown\u00a0.<\/p>\n<h3>29. diskpart<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The diskpart command is used to manage\u00a0<em>hard drive<\/em>\u00a0partitions\u00a0on your computer or laptop.\u00a0With it, you can create new partitions, delete them, and display a list of existing partitions.<\/p>\n<p>To use it, type \u201cdiskpart\u201d first.\u00a0After that, type \u201clist disk\u201d to display a list of\u00a0<em>hard drives<\/em>\u00a0on the computer.\u00a0Below is an example of the output:<\/p>\n<pre>\u00a0Disk ### Status Size Free Dyn Gpt<\/pre>\n<pre> -------- ------------- ------- ------- --- ---<\/pre>\n<pre> Disk 0 Online 476 GB 449 MB<\/pre>\n<pre> Disk 1 Online 2047 GB 0 B<\/pre>\n<pre> Disk 2 No Media 0 B 0 B<\/pre>\n<pre> Disk 3 No Media 0 B 0 B<\/pre>\n<pre> Disk 4 No Media 0 B 0 B<\/pre>\n<pre> Disk 5 No Media 0 B 0 B<\/pre>\n<p>Let&#8217;s say you want to manage partitions on disk 0. To select it, type \u201cselect disk 0\u201d.\u00a0Then type &#8220;list partition&#8221; to see a list of partitions in it.\u00a0An example of the output is as below:<\/p>\n<pre>Partition ### Type Size Offset<\/pre>\n<pre> ------------- ---------------- ------- -------<\/pre>\n<pre> Partition 1 Primary 549 MB 1024 KB<\/pre>\n<pre> Partition 2 Primary 195 GB 550 MB<\/pre>\n<pre> Partition 0 Extended 269 GB 195 GB<\/pre>\n<pre> Partition 4 Logical 29 GB 195 GB<\/pre>\n<pre> Partition 5 Logical 29 GB 225 GB<\/pre>\n<pre> Partition 6 Logical 8 GB 254 GB<\/pre>\n<pre> Partition 7 Logical 202 GB 262 GB<\/pre>\n<pre> Partition 3 Recovery 502 MB 465 GB<\/pre>\n<p>Well, now you can choose the partition you want to manage.\u00a0For example, type \u201cselect partition 1\u201d.\u00a0At this point, you can take advantage of the various sub-commands that diskpart supports.\u00a0Here are some of them that are frequently used:<\/p>\n<h4>add<\/h4>\n<p>The add sub-command works to create a new partition that is similar to another partition that already exists on your computer.\u00a0Examples of its use are as follows:<\/p>\n<pre>add disk=1<\/pre>\n<p>With this sub-command, a new partition with the same settings as partition number 1 will be created.<\/p>\n<h4>assign<\/h4>\n<p>If you use add disk, the new partition created does not have a letter.\u00a0The assign sub-command is used to specify the letter.\u00a0However, don&#8217;t forget to use the select partition command first to select the partition you want to assign letters to.<\/p>\n<p>In the example below, the letter E: is assigned to the selected partition:<\/p>\n<pre>assign letter=e<\/pre>\n<h4>delete<\/h4>\n<p>As the name implies, this sub-command is used to delete a partition.\u00a0Here is an example of its use:<\/p>\n<pre>delete partition<\/pre>\n<h4>detail<\/h4>\n<p>With the detail sub-command, you can view information about the selected partition.\u00a0Type in \u201cdetail partition\u201d and you will see output like the following:<\/p>\n<pre>Partition 1<\/pre>\n<pre>Type : 07<\/pre>\n<pre>Hidden: No<\/pre>\n<pre>Active: Yes<\/pre>\n<pre>Offset in Bytes: 1048576<\/pre>\n<pre> Volume ### Ltr Label Fs Type Size Status Info<\/pre>\n<pre> ---------- --- ----------- ----- ---------- ------- --------- --------<\/pre>\n<pre>* Volume 0 System Rese NTFS Partition 549 MB Healthy System<\/pre>\n<h3>29. driverquery<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>Driverquery command is used to display a list\u00a0<em>of drivers<\/em>\u00a0that be\u00a0<em>installed<\/em>\u00a0on your computer or laptop.\u00a0An example of the output is as follows:<\/p>\n<pre>Module Name Display Name Driver Type Link Date<\/pre>\n<pre>============ ====================== ============= ======================<\/pre>\n<pre>...<\/pre>\n<pre>PptpMiniport WAN Miniport (PPTP) Kernel 7\/15\/2016 8:28:13 PM<\/pre>\n<pre>Processor Processor Driver Kernel 7\/15\/2016 8:10:42 PM<\/pre>\n<pre>Psched QoS Packet Scheduler Kernel 7\/15\/2016 8:25:21 PM<\/pre>\n<pre>QWAVEdrv QWAVE driver Kernel 7\/15\/2016 8:28:46 PM<\/pre>\n<pre>RasAcd Remote Access Auto Con Kernel 7\/15\/2016 8:29:11 PM<\/pre>\n<pre>RasAgileVpn WAN Miniport (IKEv2) Kernel 7\/15\/2016 8:27:00 PM<\/pre>\n<pre>Rasl2tp WAN Miniport (L2TP) Kernel 7\/15\/2016 8:27:35 PM<\/pre>\n<pre>RasPppoe Remote Access PPPOE Dr Kernel 7\/15\/2016 8:28:21 PM<\/pre>\n<pre>RasSstp WAN Miniport (SSTP) Kernel 7\/15\/2016 8:27:11 PM<\/pre>\n<pre>...<\/pre>\n<h3>30. edit<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions up to Windows 7 but not supported on 64-bit systems<\/p>\n<p>Command Prompt actually has a built-in text editor tool.\u00a0To access it, you just run the CMD edit command.\u00a0For example, as shown below:<\/p>\n<pre>edit c:\\myfile.txt<\/pre>\n<p>This command will open a file called myfile.txt.\u00a0If the file does not exist, the tool will automatically create a new file with the name you specify.<\/p>\n<h3>31. exit<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The exit command is used to exit the Command Prompt or close the\u00a0running\u00a0<em>batch script<\/em>\u00a0process\u00a0.\u00a0To run it, you just need to type &#8220;exit&#8221;.<\/p>\n<h3>32. expand<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>Previously you have recognized the compact command used to compress files.\u00a0Well, expand is the opposite.\u00a0This command is used to decompress.\u00a0The syntax is quite simple:<\/p>\n<pre>expand &lt;source&gt; &lt;destination&gt;<\/pre>\n<p>&lt;source&gt; is the location of the file you want to open, while &lt;destination&gt; is the directory where you want to put the contents of the file.\u00a0An example of its use is as follows:<\/p>\n<pre>expand d:\\i386\\hal.dl_ c:\\windows\\system32\\hall.dll<\/pre>\n<h3>33. find<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The Command Prompt allows you to search for specific text in a file with the find command.\u00a0The syntax is like this:<\/p>\n<pre>find [string] [drive\\ file name]<\/pre>\n<p>For example, let&#8217;s say you want to find the text &#8220;REM&#8221; in the autoexec.bat file located on\u00a0<em>the<\/em>\u00a0C:\u00a0<em>drive<\/em>\u00a0.\u00a0Then you need to run the following command:<\/p>\n<pre>find \"REM\" c:\\autoexec.bat<\/pre>\n<p>Note that the find command will search for text that matches what you typed.\u00a0Therefore, you need to pay attention to the use of capital letters.<\/p>\n<p>For example, this command will not display the text &#8220;rem&#8221; in lowercase in your search results.<\/p>\n<p>However, you can also ask the command to ignore the typeface.\u00a0To do this, you just add \/I before the text you&#8217;re looking for.<\/p>\n<h3>34. ipconfig<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>ipconfig is a CMD command used to display information about specified network settings for your computer or laptop.<\/p>\n<p>By typing \u201cipconfig\u201d in the Command Prompt, you can already see the information, as in the following example:<\/p>\n<pre>Connection-specific DNS Suffix . : hsd1.ut.comcast.net.<\/pre>\n<pre>IP Address. . . . . . . . . . . . : 192.168.201.245<\/pre>\n<pre>Subnet Mask . . . . . . . . . . . : 255.255.255.0<\/pre>\n<pre>Default Gateway . . . . . . . . . : 192.168.201.1<\/pre>\n<p>However, you can also view the full information by adding \u201c\/all\u201d at the end of the command.\u00a0The result will be like this:<\/p>\n<pre>Host Name . . . . . . . . . : COMPUTERH1<\/pre>\n<pre>DNS Servers . . . . . . . . : 123.45.67.8<\/pre>\n<pre>111.111.111.1<\/pre>\n<pre>111.111.111.1<\/pre>\n<pre>Node type .. .. .. .. ..: Broadcast<\/pre>\n<pre>NetBIOS Scope ID. . . . . . :<\/pre>\n<pre>IP Routing Enabled. . . . . : No<\/pre>\n<pre>WINS Proxy Enabled. . . . . : No<\/pre>\n<pre>NetBIOS Resolution Uses DNS : No<\/pre>\n<pre>0 Ethernet adapter :<\/pre>\n<pre>Description . . . . . . . . : PPP Adapter.<\/pre>\n<pre>Physical Address. . . . . . : 44-44-44-54-00-00<\/pre>\n<pre>DHCP Enabled. . . . . . . . : Yes<\/pre>\n<pre>IP Address. . . . . . . . . : 123.45.67.12<\/pre>\n<pre>Subnet Mask . . . . . . . . : 255.255.0.0<\/pre>\n<pre>Default Gateway . . . . . . : 123.45.67.8<\/pre>\n<pre>DHCP Server . . . . . . . . : 255.255.255.255<\/pre>\n<pre>Primary WINS Server . . . . :<\/pre>\n<pre>Secondary WINS Server . . . :<\/pre>\n<pre>Lease Obtained. . . . . . . : 01 01 80 12:00:00 AM<\/pre>\n<pre>Lease Expires . . . . . . . : 01 01 80 12:00:00 AM<\/pre>\n<pre>1 Ethernet adapter :<\/pre>\n<pre>Description . . . . . . . . : 3Com 3C90x Ethernet Adapter<\/pre>\n<pre>Physical Address. . . . . . : 00-50-04-62-F7-23<\/pre>\n<pre>DHCP Enabled. . . . . . . . : Yes<\/pre>\n<pre>IP Address. . . . . . . . . : 111.111.111.108<\/pre>\n<pre>Subnet Mask . . . . . . . . : 255.255.255.0<\/pre>\n<pre>Default Gateway . . . . . . : 111.111.111.1<\/pre>\n<pre>DHCP Server . . . . . . . . : 111.111.111.1<\/pre>\n<pre>Primary WINS Server . . . . :<\/pre>\n<pre>Secondary WINS Server . . . :<\/pre>\n<pre>Lease Obtained. . . . . . . : 11 16 00 12:12:44 AM<\/pre>\n<pre>Lease Expires . . . . . . . :<\/pre>\n<p>Apart from displaying your network settings, the ipconfig command also has other uses when used with its sub-commands.\u00a0Here are some commonly used sub-commands:<\/p>\n<ul>\n<li>\/release \u2014 removes DHCP and IP address settings for all network adapters in use.\u00a0You can also type the adapter name to use ipconfig\/release against only that adapter<\/li>\n<li>\/renew \u2014 Updates DHCP and IP address settings for all network adapters in use.\u00a0Like the previous sub-command, you can also use ipconfig\/renew on the selected adapter<\/li>\n<li>\/flushdns \u2014 clears the\u00a0DNS\u00a0cache\u00a0stored on your computer.\u00a0This needs to be done regularly so that you can still access the sites you usually visit<\/li>\n<\/ul>\n<h3>35. logoff<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>As the name implies, the logoff command is used to log off from your computer.\u00a0In the context of a local computer network, this CMD command can also be used to terminate a specific user session.<\/p>\n<p>To run it, you just type &#8220;logoff&#8221;.\u00a0If you are an administrator, you can terminate a user&#8217;s session by adding their computer ID, as in the following example:<\/p>\n<pre>logoff 12<\/pre>\n<h3>36. move<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The move command allows you to move one or more files to another directory.\u00a0In fact, you can use it to move one directory into another as well.\u00a0The syntax is as follows:<\/p>\n<pre>move &lt;file name&gt; &lt;destination&gt;<\/pre>\n<p>An example looks like this:<\/p>\n<pre>move stats.doc c:\\statistics<\/pre>\n<p>If you are not currently in the file directory, you will need to specify the partition letter and directory name:<\/p>\n<pre>move d:\\docs\\stats.doc c:\\statistics<\/pre>\n<p>If you want to move more than one file, you must separate each one with a comma and a space:<\/p>\n<pre>move stats.doc, morestats.doc c:\\statistics<\/pre>\n<p>So, to move a directory into another directory, you need to add double quotes at the beginning and end of the directory name:<\/p>\n<pre>move \"direktori1\" direktori2<\/pre>\n<h3>37. msg<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 2000<\/p>\n<p>If you are on a local computer network, you can send messages to other users with the msg command.\u00a0The syntax is like this:<\/p>\n<pre>msg &lt;username&gt; &lt;message&gt;<\/pre>\n<p>Below is an example if you send a message that says \u201cHello\u201d to a user named \u201cuser01\u201d:<\/p>\n<pre>msg user01 Halo<\/pre>\n<h3>38. pause<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The pause command is used to stop a\u00a0running\u00a0<em>batch<\/em>\u00a0file\u00a0.\u00a0When executed, the message \u201cPress any key to continue\u201d will appear on the screen.\u00a0To continue the file process, you just press any key on the keyboard.<\/p>\n<h3>39. print<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>Perhaps you didn&#8217;t know that you can print text files from the Command Prompt.\u00a0To do this, you need to specify the filename (filename) and\u00a0<em>the<\/em>\u00a0printer\u00a0<em>port<\/em>\u00a0used (device), as in the following syntax:<\/p>\n<pre>print &lt;filename&gt; &lt;device&gt;<\/pre>\n<p>However, you should know the type of port your printer is using.\u00a0For parallel ports, the printer name used starts with LPT.\u00a0As for the serial port, the printer name starts with COM.\u00a0To make it clearer, let&#8217;s look at the example below:<\/p>\n<pre>print c:\\file.txt \/d:lpt1<\/pre>\n<p>By running the example command, you will print a file.txt that is on the C: partition with the printer on port LPT1.<\/p>\n<h3>40. query<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>query is a CMD command used to display four types of information related to the\u00a0<em>RD session host server<\/em>\u00a0.\u00a0Each piece of information can be represented by the following syntax:<\/p>\n<ul>\n<li>query process \u2014 display a list of processes running on the\u00a0<em>RD session host server<\/em><\/li>\n<li>query session \u2014 display a list of existing sessions on the\u00a0<em>RD session host server<\/em><\/li>\n<li>query termserver \u2014 display a list of\u00a0<em>RD session host servers<\/em>\u00a0on the local network<\/li>\n<li>query user \u2014 displays information about user sessions on an\u00a0<em>RD session host server<\/em><\/li>\n<\/ul>\n<h3>41. recover<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>If the\u00a0<em>hard drive<\/em>\u00a0is damaged, you can try to restore the data on it with the recover command.<\/p>\n<p>However, you can only\u00a0<em>recover<\/em>\u00a0one file at a time.\u00a0In addition, you must know the name of the file and its location.\u00a0For example, as shown below:<\/p>\n<pre>recover d:\\fiction\\story.txt<\/pre>\n<h3>42. rename<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>As the name implies, the rename command is used to rename files and directories.\u00a0Just like the previous command, rename requires you to specify the directory name of the selected file or directory.<\/p>\n<p>For example, with the command below you can change the file \u201ccomputer.jpg\u201d to \u201ctext.jpg\u201d:<\/p>\n<pre>rename d:\/pictures\/computer.jpg text.jpg<\/pre>\n<p>As a side note, you can also use the ren command to rename a file or directory.\u00a0The syntax of this command is no different from that of the rename command.<\/p>\n<h3>43. repair-bde<\/h3>\n<p><strong>Supported on:<\/strong>\u00a0Windows 7, 8, and 10<\/p>\n<p>repair-bde is also a command that works to save files from\u00a0a damaged\u00a0<em>hard drive<\/em>\u00a0.\u00a0However, it is used for\u00a0<em>hard drives<\/em>\u00a0encrypted with BitLocker.<\/p>\n<p>To be able to use repair-bde, you must have\u00a0another\u00a0<em>hard drive<\/em>\u00a0on your computer.\u00a0It is used as a repository for files from\u00a0a damaged\u00a0<em>hard drive<\/em>\u00a0.<\/p>\n<p>The data on\u00a0<em>the<\/em>\u00a0second\u00a0<em>hard drive<\/em>\u00a0will be\u00a0<em>overwritten<\/em>\u00a0or overwritten with files that can be salvaged from\u00a0the damaged\u00a0<em>hard drive<\/em>\u00a0.\u00a0Therefore, it is recommended that you use\u00a0<em>an<\/em>\u00a0empty\u00a0<em>hard drive<\/em>\u00a0.<\/p>\n<p>Also, you will need a\u00a0<em>recovery key<\/em>\u00a0,\u00a0<em>recovery key package<\/em>\u00a0,\u00a0<em>recovery<\/em>\u00a0password, or password to unlock the\u00a0<em>hard drive<\/em>\u00a0.<\/p>\n<p>With several factors involved, repair-bde does sound complicated.\u00a0However, the syntax is quite easy to understand:<\/p>\n<pre>repair-bde &lt;inputvolume&gt; &lt;outputvolume&gt; &lt;-rk&gt; &lt;\u2013rp&gt; &lt;-pw&gt; &lt;\u2013kp&gt;<\/pre>\n<p>The following is an explanation of each part of the syntax above:<\/p>\n<ul>\n<li>inputvolume \u2014 the letter of the\u00a0<em>hard drive<\/em>\u00a0partition\u00a0whose files you want to save<\/li>\n<li>outputvolume \u2014 the letter of the\u00a0<em>hard drive<\/em>\u00a0partition\u00a0that will be used to store the files<\/li>\n<li>-rk \u2014\u00a0<em>recovery key<\/em>\u00a0file\u00a0from\u00a0encrypted\u00a0<em>hard drive<\/em><\/li>\n<li>-rp \u2014\u00a0<em>recovery<\/em>\u00a0password to unlock\u00a0encrypted\u00a0<em>hard drive<\/em><\/li>\n<li>-pw \u2014 password to open\u00a0an encrypted\u00a0<em>hard drive<\/em><\/li>\n<li>-kp \u2014\u00a0<em>recovery key package<\/em>\u00a0to unlock\u00a0encrypted\u00a0<em>hard drives<\/em><\/li>\n<\/ul>\n<p>Even if -rk is a file, you must specify the letter of the partition and the directory it is in.<\/p>\n<p>To make it clearer, let&#8217;s see an example of using the repair-bde command below:<\/p>\n<pre>repair-bde c: d: -rk f:\\RecoveryKey.bek<\/pre>\n<p>The command will try to move files from\u00a0<em>drive<\/em>\u00a0C: to\u00a0<em>drive<\/em>\u00a0D: with a\u00a0<em>recovery key<\/em>\u00a0file\u00a0named RecoveryKey.bek.<\/p>\n<p>For the use of the repair-bde command that uses the\u00a0<em>recovery key package<\/em>\u00a0, the example is as follows:<\/p>\n<pre>repair-bde C: D: -rp 111111-222222-333333-444444-555555-666666-777777-888888<\/pre>\n<h3>44. replace<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>The replace command is used to replace one or more files in a directory with another file.\u00a0This command is useful if the same file exists in multiple directories and needs to be updated regularly.<\/p>\n<p>The syntax is like this:<\/p>\n<pre>replace &lt;drive1&gt; &lt;filename&gt; &lt;drive2&gt; &lt;\/p&gt; &lt;\/r&gt; &lt;\/s&gt;<\/pre>\n<p>As you can see above, there are three options that can be used in the replace command, namely:<\/p>\n<ul>\n<li>\/p \u2014 displays a confirmation question before you change files on &lt;drive2&gt;<\/li>\n<li>\/r \u2014 used to replace files with\u00a0<em>read only<\/em>\u00a0attributes<\/li>\n<li>\/s &#8211; used to replace all files in subdirectories in &lt;drive2&gt;<\/li>\n<\/ul>\n<p>Let&#8217;s see an example of its use below:<\/p>\n<pre>replace f:\\phones.cli c:\\ \/s<\/pre>\n<p>With this command, all the \u201cphones.cli\u201d files in the C: partition and all of its subdirectories will be replaced with files in the F: partition.<\/p>\n<h3>45. rmdir<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions of Windows<\/p>\n<p>rmdir is used to remove empty directories.\u00a0However, this CMD command can also delete non-empty directories in Windows XP and later versions.<\/p>\n<p>The simple usage is like this:<\/p>\n<pre>rmdir c:\\test<\/pre>\n<p>If you want to delete files and subdirectories in them, you just add \/s after the command above:<\/p>\n<pre>rmdir c:\\test \/s<\/pre>\n<p>You can also use the rd command to delete a directory as it has the same function as rmdir.<\/p>\n<h3>46. robocopy<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>Previously you have learned about the copy command.\u00a0robocopy has the same function, but it can also copy directories and partitions.<\/p>\n<p>Its syntax is similar to that of the copy command.\u00a0The difference is that the files you want to copy to the destination directory are listed after you specify the name of the directory:<\/p>\n<pre>robocopy &lt;source&gt; &lt;destination&gt; &lt;file(s)&gt; &lt;option&gt;<\/pre>\n<p>As can be seen above, after specifying the file you want to copy you can use one or more options.\u00a0Here are some options that can be used:<\/p>\n<ul>\n<li>\/s \u2014 copy subdirectories that are in the source directory, unless the subdirectory is empty<\/li>\n<li>\/e \u2014 copy subdirectories in the original directory, whether they contain or not<\/li>\n<li>\/copyall \u2014 the information of the copied file is kept when it is copied to the destination directory<\/li>\n<li>\/nocopy \u2014 the information of the copied file is not saved when it is copied to the destination directory<\/li>\n<li>\/move \u2014 delete the original file after copying<\/li>\n<li>\/a \u2014 only copies files with the\u00a0<em>archive<\/em>\u00a0attribute<\/li>\n<li>\/a+:&lt;attribute&gt; \u2014 copies and defines file attributes.\u00a0The attribute symbols are as mentioned earlier in the discussion about the attrib command<\/li>\n<li>\/a-:&lt;attribute&gt; \u2014 like the previous option, but removes file attributes<\/li>\n<li>\/ia: &lt;attribute&gt;-only copies files with the attributes you specify<\/li>\n<li>\/xa: &lt;attribute&gt; &#8211; excludes files with the attributes you specify<\/li>\n<li>\/xf file &lt;filename&gt; \u2014 exclude files whose names have a specific word<\/li>\n<li>\/xf dirs &lt;directoryname&gt; \u2014 exclude directories whose names have a specific word<\/li>\n<li>\/max: n-only copies files below the size you specify (n)<\/li>\n<li>\/min: n-only copies files above the size you specify (n)<\/li>\n<\/ul>\n<h3>47. schtasks<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows XP<\/p>\n<p>At the beginning of this article you learned about the at command which is used to automate actions.\u00a0Well, schtasks have the same function, but the syntax is different:<\/p>\n<pre>schtasks \/parameter &lt;arguments&gt;<\/pre>\n<p>What the \/parameter on schtasks means is its sub-command.\u00a0Here are some of them:<\/p>\n<ul>\n<li>\/create \u2014 create an automation<\/li>\n<li>\/delete \u2014 deletes an automation<\/li>\n<li>\/query \u2014 display a list of automated commands<\/li>\n<li>\/change \u2014 change the settings of an automation<\/li>\n<li>\/run \u2014 run an automation<\/li>\n<li>\/end \u2014 stop a running automation<\/li>\n<\/ul>\n<p>Whereas &lt;arguments&gt; are actions that are automated with schtasks.\u00a0There are so many things you can do with this command.\u00a0Below are some commonly used &lt;arguments&gt;:<\/p>\n<ul>\n<li>\/tr \u2014 specify the name of the file to run with schtasks and its directory<\/li>\n<li>\/tn &#8211; specifies the name of the automated action<\/li>\n<li>\/sc \u2014 specifies the automation frequency.\u00a0You can specify it per minute, hour, day, week and month.\u00a0You can even create automations that only run once.<\/li>\n<li>\/mo \u2014 specify the frequency in more detail.\u00a0For example, you want to run a file every 120 minutes.<\/li>\n<li>\/d \u2014 specify the automation day<\/li>\n<li>\/m \u2014 specify the automation month<\/li>\n<li>\/i \u2014 specify the time interval between the automation of an action<\/li>\n<li>\/st \u2014 Specifies when the automation starts.\u00a0You need to remember that the format used is 24 hours.\u00a0So, if you want to set an action for 2pm, then type 14:00.<\/li>\n<li>\/et \u2014 set the time for automation to stop<\/li>\n<li>\/k \u2014 removes automation when it stops<\/li>\n<\/ul>\n<p>So that you can understand it more easily, let&#8217;s look at the example below.\u00a0The following example is used to create an automation called SecurityScript with the target file sec.vbs:<\/p>\n<pre>schtasks \/create \/tn \"Security Script\" \/tr sec.vbs \/sc minute \/mo 100 \/st 17:00 \/et 08:00 \/k<\/pre>\n<h3>48. sfc<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 98<\/p>\n<p>The sfc or\u00a0<em>system file checker<\/em>\u00a0command is\u00a0used to find and replace Windows system files with the correct version.\u00a0This is especially useful if there is a problem in your computer system that is difficult to fix.<\/p>\n<p>The syntax is quite easy to understand:<\/p>\n<pre>sfc \/command<\/pre>\n<p>\/command is a sub-command that can be used with sfc.\u00a0The following is a list of sub-commands:<\/p>\n<ul>\n<li>\/scannow \u2014 find and repair corrupt system files<\/li>\n<li>\/verifyonly \u2014 looking for corrupt system files<\/li>\n<li>\/scanfile \u2014 scans for damage to selected files and repairs them.\u00a0You need to name the file and directory to use this sub-command<\/li>\n<li>\/verifyfile \u2014 scans for damage to selected files.\u00a0As in the previous sub-command, you need to name the file and directory<\/li>\n<\/ul>\n<p>Below is an example of using the sfc command to scan for corruption in the kernel32.dll file and fix it:<\/p>\n<pre>sfc \/VERIFYFILE=c:\\windows\\system32\\kernel32.dll<\/pre>\n<h3>49. shadow<\/h3>\n<p><strong>Supported on:<\/strong>\u00a0Windows XP, Vista, and 7<\/p>\n<p>The shadow command can be used if you are managing an\u00a0<em>RD session host server<\/em>\u00a0.\u00a0With it, you can control other computers on the server.\u00a0Here is the syntax:<\/p>\n<pre>shadow {&lt;SessionName&gt; | &lt;SessionID&gt;} [\/server:&lt;ServerName&gt;] [\/v]<\/pre>\n<p>So, you can control a computer on the\u00a0<em>RD session host server<\/em>\u00a0by simply mentioning the\u00a0<em>session<\/em>\u00a0name\u00a0or ID.\u00a0For example in the following example:<\/p>\n<pre>shadow 93<\/pre>\n<p>With this command, you will control the computer with ID 93.<\/p>\n<h3>50. shutdown<\/h3>\n<p><strong>Supported in:<\/strong>\u00a0all versions after Windows 2000<\/p>\n<p>If you want to\u00a0<em>shut down<\/em>\u00a0,\u00a0<em>sleep<\/em>\u00a0, or\u00a0<em>log off your<\/em>\u00a0computer from the Command Prompt, you can use the shutdown command.\u00a0In addition, you can also use it to do the same on other computers on a network.<\/p>\n<p>The syntax is simple, but there are a few\u00a0<em>arguments<\/em>\u00a0you can use with this CMD command:<\/p>\n<pre>shutdown &lt;arguments&gt; &lt;TargetComputer&gt;<\/pre>\n<p>Here are some\u00a0frequently used\u00a0<em>arguments<\/em>\u00a0or sub-commands:<\/p>\n<ul>\n<li>\/i \u2014 displays\u00a0<em>graphical user interface<\/em>\u00a0or GUI\u00a0<em>shutdown<\/em><\/li>\n<li>\/l \u2014\u00a0<em>log off<\/em>\u00a0from the computer<\/li>\n<li>\/s &#8211;\u00a0<em>shut down<\/em>\u00a0or turn off the computer<\/li>\n<li>\/r &#8211;\u00a0<em>restart the<\/em>\u00a0computer<\/li>\n<li>\/a &#8211; cancel\u00a0computer\u00a0<em>shutdown<\/em><\/li>\n<li>\/p \u2014 shuts down computers on the local network directly.\u00a0This means\u00a0that the computer\u00a0<em>shutdown<\/em>\u00a0GUI\u00a0you normally see will not be displayed<\/li>\n<li>\/h \u2014 turn on\u00a0<em>hibernate<\/em>\u00a0mode<\/li>\n<li>\/t \u2014 the specified amount of time before one of the sub-commands is executed<\/li>\n<\/ul>\n<p>So, if you want to shut down your personal computer, you can run the following command:<\/p>\n<pre>shutdown \/i \/s<\/pre>\n<p>However, if you are managing a local network and want to shut down one of the computers, below is an example of the required command:<\/p>\n<pre>shutdown \/i \/s \/t 45<\/pre>\n<h2>CMD command: Close<\/h2>\n<p>After reading this article, you should know that there are tons of CMD commands that you can use.\u00a0Its functions also vary, ranging from basic operations such as copying and moving files to managing computers on a local network.<\/p>\n<p>Well, from now on you can use the commands in this article to use the Command Prompt.\u00a0If you have any questions, don&#8217;t hesitate to leave your comments in the column provided below.<\/p>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>Are you a Windows PC user?\u00a0Are you looking for a collection of\u00a0Command Prompt (CMD)\u00a0commands\u00a0that can make it easier to operate the device? Although currently all the cool features in\u00a0the Windows operating system\u00a0can be used directly in a beautiful\u00a0GUI (Graphical User Interface)\u00a0mode\u00a0, in reality CMD still cannot be abandoned by its users. Whether it&#8217;s to help [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1127,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/posts\/1137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/comments?post=1137"}],"version-history":[{"count":0,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/posts\/1137\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/media\/1127"}],"wp:attachment":[{"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/media?parent=1137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/categories?post=1137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matob.web.id\/news\/wp-json\/wp\/v2\/tags?post=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}