How do I delete a file or folder in Windows?

Windows operating system provides two ways to delete file and folder.

1. Deleting using My Computer or Windows Explorer

First, you need to open the file or folder you want to delete. To do this, open My Computer (or Windows Explorer in Windows XP) by clicking the Start button and choosing My Computer. Find the file or folder you want to delete, right-click it and select Delete. Alternatively, you can click the Delete key on your keyboard or click the File menu and choose Delete from the menu.

If you are attempting to delete a folder with contents, you’ll be prompted to confirm your action. You may be asked if you want to delete all of its contents or move them to the Recycle Bin first. It’s generally a good idea to move them to the Recycle Bin so that you can still recover any files you might need later.

2. Deleting from the Command Prompt

If you’re more comfortable using the command line interface, then you can use the del or rd command to delete a file or folder. To use these commands, open the command prompt by clicking the Start button, selecting Run and typing “cmd” (without quotes).

From the command prompt you can type:

• del filename – to delete a specific file
• del * – to delete all files in the current directory
• rd foldername – to delete a specific folder
• rd /s foldername – to delete a folder and all of its contents

Any time you delete a file, make sure that you are deleting the correct file, as deleted files cannot be recovered.