some basic commands for command prompt

Open Command Prompt

  1. how to change drive 

drivename:


2. how to change directory / folder

cd <folder/directory name>

Note: Please use double quotes if the folder name has space. 

           If no space is there, no need of double quotes

4. see folder contents

dir




If folder has many folders 

You may use

dir /p                                                for page wise

dir /w                                               for width wise

dir /p /w                                           for both page wise and width wise

5. create a folder

md folder_name





6. Remove a folder

rd "folder name"




if folder has some contents 

use rd /S "folder name" and then press y

or 

use rd /S /Q "folder name"

7. add properties like hide, system file, readonly to file or folder

  • to see properties of files or folder
    • attrib


  • to hide or unhide a file
    • attrib +h "file name or fodler name"                        for hiding

    • attrib -h "file or folder name"                                    for unhiding
  • to make it readonly
    • attrib +r "file or folder name"                                   for readonly
    • attrib -r " file or folder name"                                    for readandwrite
  • to make it system file or folder
    • attrib +s "file or folder name"                                   for system file
    • attrib -s " file or folder name"                                   for removing system propertiies
  • to make multiple of them
    • attib +s +h +r <file name>
Note : You may remove attributes as you like . like you can remove +r from above command so it can be only sysem and hidden file not readonly
if you want to apply attribute to all subfolder and files in a folder then
attrib +s +h +r /S /D

Comments

Popular Posts