Search This Blog

Wednesday, April 7, 2010

How to delete file and folder

When deleting files or folders in Windows the default delete behaviour is for the file or folder to be moved to the recycle bin. There it will remain till either a) you empty your recycle bin or b) you fill your recycle bin. When your recycle bin is full the oldest files will be permanently deleted to clear room for the newly deleted files.
There are many ways to delete files and folders. This tutorial will guide you through the processes:

First Method

This is the easiest method to delete files and folders in Windows.
  1. You can use either Windows Explorer or My Computer to navigate to the file or folder you wish to delete.
    • Using Windows Explorer: Open Windows Explorer (Left click Start then Programs then Accessories then Windows Explorer) or (Hold down the Windows key and press E)
    • Using My Computer: Windows XP Users click Start then My Computer. All other Windows users double left click the My Computer icon on your desktop.
  2. Navigate to the file or folder that you would like to delete.
  3. Highlight the file or folder by left clicking it once.
  4. Now press the Delete key on your keyboard.
  5. A window will then popup asking for confirmation to send the file or folder to the Recycle Bin. Click Yes to move the file to the recycle bin or No to keep the file where it is.

    Send to the Recycle Bin confirmation box

Second Method

  1. You can use either Windows Explorer or My Computer to navigate to the file or folder you wish to delete.
    • Using Windows Explorer: Open Windows Explorer (Left click Start then Programs then Accessories then Windows Explorer) or (Hold down the Windows key and press E)
    • Using My Computer: Windows XP Users click Start then My Computer. All other Windows users double left click the My Computer icon on your desktop.
  2. Navigate to the file or folder that you would like to delete.
  3. Highlight the file or folder by left clicking it once.
  4. Then from the top toolbar click File then Delete.

    Delete a file or folder using windows explorer

  5. A window will then popup asking for confirmation to send the file or folder to the Recycle Bin. Click Yes to move the file to the recycle bin or No to keep the file where it is.

    Send to the Recycle Bin confirmation box

Third Method

In this example I will delete a file from my desktop however this method can be used to drag files from a Windows Explorer window to the recycle bin also.
  1. Left click the file or folder you wish to delete and keep the mouse button held down. Then drag the file on top of the Recycle bin.

    Delete a file or folder dragging on to the recycle bin

Fourth Method

This method can be used by Windows XP, and Windows 2003 users.
  1. Open My Computer ((Left click Start/My Computer) or double click the My Computer icon on your desktop).
  2. Navigate to the file or folder you want to delete.
  3. Then highlight the file or folder by left clicking it once.
  4. Now click Delete this file, or Delete this folder from the File and Folder Tasks menu in your Common Tasks toolbar.

    Delete a file or folder using Common Tasks

  5. A window will then popup asking for confirmation to send the file or folder to the Recycle Bin. Click Yes to move the file to the recycle bin or No to keep the file where it is.

    Send to the Recycle Bin confirmation box

Using the Command Prompt

Important Note: when deleting files and folders from the command prompt these files/folders do not get soft-deleted to the recycle bin. Instead they are permanently deleted.

How to delete a file using the Command Prompt

To start the command prompt in Windows left click Start then Run. Type in "CMD" (without the "") and hit Enter.
  1. First locate the file that you would like to delete.
  2. Then on the command prompt type:

    Code:

    del filename.txt


    Delete a file using command line

    and then hit Enter.

  3. You can then use:

    Code:

    dir


    List files and folders using command line

    and then hit Enter to make sure your file has been deleted.
Note: If you want to delete a file with spaces in its name you must wrap the name in "". For example:

Code:

del "filename 1"
If you want to delete more than one file you can do so like this:

Code:


del "filename 1.txt" "filename 2.txt" del "filename 3.txt"

How to delete a folder using the Command Prompt

To start the command prompt in Windows left click Start then Run. Type in "CMD" (without the "") and hit Enter.
  1. First locate the folder that you would like to delete.
  2. Then on the command prompt type:

    Code:

    rmdir foldername


    Delete a folder using command line

    and then hit Enter.

  3. You can then use:


    Code:



    dir


    List files and folders using command line

    and then hit Enter to make sure your folder has been deleted.
Note: If you want to delete a folder with spaces in its name you must wrap the name in "". For example:

Code:


rmdir "foldername 1"
If you want to delete more than one folder you can do so like this:

Code:


rmdir "foldername 1" "foldername 2" "foldername 3"

No comments:

Post a Comment