0% found this document useful (0 votes)
445 views

How To Delete File Using CMD

To delete a file using CMD: 1. Open the Command Prompt 2. Enter the command "del /f filename" where filename is the name of the file you want to delete 3. This will permanently delete the file from your hard drive without moving it to the Recycling Bin.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
445 views

How To Delete File Using CMD

To delete a file using CMD: 1. Open the Command Prompt 2. Enter the command "del /f filename" where filename is the name of the file you want to delete 3. This will permanently delete the file from your hard drive without moving it to the Recycling Bin.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

How to Delete File with CMD

Enter the command prompt (Start-> Run-> Cmd) and enter ‘del /f filename’, where ‘filename’ is
the name of the file or files (you can specify multiple files using commas) you want to delete

Deleting the File with Command Prompt

1. 1
Open Command Prompt. In this case, you'll want to avoid the "Administrator" (or
"Admin") version of Command Prompt unless you're deleting a file in the "System32"
folder. You can open Command Prompt in a variety of ways depending on your version
of Windows:
 Hold down ⊞ Win and press X , then click Command Prompt above the Start button.
 Right-click the Start button in the bottom-left corner of the screen, then click Command
Prompt in the pop-up window.
 Type "Command Prompt" into the Start menu search bar (for Windows 8, hover your
mouse in the top-right corner of the screen and then click the magnifying glass), then
click the "Command Prompt" icon when it appears.
 Open the "Run" app from the Start menu, type in "cmd", and click OK.

2. 2
Type in c d d e s k t o p and press ↵ Enter . Doing so will change the location (or
"directory") in Command Prompt to your desktop.
 There are other ways you can change the Command Prompt directory if need be.
 Opening Command Prompt in "Administrator" mode will change the directory to the
"System32" file. For this reason, do not open Command Prompt in "Administrator"
unless your file is in the "System32" folder.
3. 3
Type in d e l [ f i l e n a m e . f i l e t y p e ] . Replace "filename.filetype" with your file's
actual name and extension.
 For example, a picture file named "icecream" would become i c e c r e a m . p n g , a text file
named "notes" would become n o t e s . t x t , and so on.
 For files with spaces in their names, place quotation marks around the entire file
name: " I l i k e t u r t l e s . j p g " instead of I _ l i k e _ t u r t l e s . j p g or similar.
 To delete all files on your desktop that share the same extension (e.g., all text files),
type * . f i l e t y p e where "filetype" is the extension (e.g., * . t x t ).

4. 4
Press ↵ Enter . Doing so will , and you'll see a new, blank line appear in Command
Prompt. Your file is now gone.
 Since the "del" command removes files directly from your hard drive, you won't need to
delete the file again from the Recycling Bin.

How to Delete a single file using the Command Prompt on Windows


 Step 1: Run the Command prompt on windows.
 Step 2: You will need to type the following into the command line and press enter.
DEL /F /Q /A <File Path>
Here the /F parameter stands or force deletion of files, /Q parameter ensures the Forces deletion of read-only
files, /A parameter will select only the files with the ready for archiving attribute, Finally you can
replace <File path> with the path of the file or folder.
For example: Type in the following into the command prompt and press enter.

DEL /F /Q /A C:\Users\Lovejeet\Desktop\infected.txt

How to Delete a Folder using the Command Prompt on Windows


 Step 1: Run the Command prompt on windows.
 Step 2: You will need to type the following into the command line.
RD /S /Q <Path of the Folder>
Here RD stands for Remove Directory, /S deletes all subfolder and files, /Q Deletes directories without
confirmation.
For example: Type in the following into the command line and press enter.

RD /S /Q C:\Users\Lovejeet\Desktop\Folder

You might also like