Sunday, September 20, 2015

How to hide Drives in windows 7 Using Command Prompt.

The Command Prompt in Windows is a very powerful tool to accomplish certain tasks that usually can’t be done unless you have a third-party tool. Today, I am going to share an interesting use of Command Line. One can use the Command Prompt to hide one or more drives in the explorer.
Follow the steps bellow..
     1. Type cmd in Start menu search area and hit Enter to launch Command Prompt.
     2. In the Command Prompt, type diskpart and hit enter key. Click Yes if you are prompted with UAC (User Account Control) dialog-box.
     

     3. And then type list vol and hit enter to see list of all drives.
     
     4. Select the drive that you want to hide. To do this, type select vol 3 (here 3 is the volume number).


    5. To hide a drive, type remove letter D. Here, D is the selected drive letter that you want to hide.


     6. You are done. Close the prompt and click on my computer, that drive will not be there. |Enjoy|

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

To show the hidden drive, follow the steps given below :

     1. Type cmd in Start menu search area and hit Enter to launch Command Prompt.
     2. In the Command Prompt, type diskpart and hit enter key. Click Yes on prompted dialog-box.
     3. And then type list vol and hit enter to see list of all drives.
     4. Select the volume number for which you want to assign a drive letter and show in the explorer.
         Type select vol 3 (here, 3 is the volume number) and hit Enter key.
     5. Once selected, type assign letter D and hit Enter key to see the drive in explorer(replace D with the drive letter that you have previously removed).



A big thanks for reading..|Enjoy|

How to configure with auto-indent in vi / vim editor.

To automatically indent lines using the vi editor, set the autoindent flag:

    1. If you are currently in insert or append mode, press "Esc".
    2. Press : (the colon). The cursor should reappear at the lower left corner of the screen beside a colon prompt.
    3. Enter the following command: set autoindent
    4. Now press enter.

Now, when you are inserting text, if you press Enter at the end of your text, vi will automatically indent the next new line to match the indent of the previous one. This is useful for editing tables with indented columns or program source code.

To turn off the automatic indentation, follow the preceding instructions; however, in step 3, at the colon prompt, enter: set noautoindent

Normally vi will "forget" the particular setting you've chosen once you've left the editor. But if you want to make this setting permanent, You can make setting take effect automatically whenever you use vi on a particular account by placing the appropriate set statement as a line in a file in your "vim" directory named: ~/.vimrc

    1.Open the terminal and go to "vim" directory.. Enter the following commands bellow..
              a. cd ..
                  Now you are in home directory.
              b. cd ..
                  Now you are in root directory.
              c. cd usr
                  Now you are in user directory.
              d. cd share
                  Now you are in share directory.
              e. cd vim
                  Now you are in vin directory which contains the file ~/.vimrc
    2. Now enter the command: gedit ~/.vimrc
        Text editor will open the ~/.vimrc file
    3. Now add the following command to that file
                       :set autoindent
                       :set smartindent
                       :set cindent
    4. Now save the file and close that file.
    5. Close the terminal and reopen it again.. thats it. |Enjoy|