Vous êtes sur la page 1sur 5

How to Delete a File from the Command

Prompt
Here's How:
1. Do step 2, 3, or 4 for how you would like to delete your file(s).
2. To Use a Elevated Command Prompt in Windows
NTE: This will allow you to delete any file(s) on the computer.
A) Open !older ptions, uncheck the Hide e"tensions #or $nown #ile t%pes box, and click
on &. (see screenshot below)
B) Open a Elevated 'ommand prompt.
C) Go to step .
3. To Use a Command Prompt in Windows
NTE: This will only allow you to delete any file(s) in your user folders.
A) Open !older ptions, uncheck the Hide e"tensions #or $nown #ile t%pes box, and click
on &. (see screenshot below)
B) Open a 'ommand prompt.
C) Go to step .
4. To Use a Command Prompt at (oot
NTE: This will allow you to delete any file(s) on the computer.
A) Open a 'ommand prompt at )oot.
B) !n the co""and pro"pt, type dis$part and press Enter. (see screenshot below)
C) !n the co""and pro"pt, type list vol*me and press Enter. (see screenshot below)
NTE: This will let you see what the drive letter is for the drive that you want to delete the
file in since it may not always be the same drive letter that it is in Windows.
D) After "akin# note of the dri$e letter, type e"it and press Enter. (see screenshot below)
%) Go to step .
+. Do step ,, -, ., /, or 10 for how you would like to delete your file(s).
,. To 1elete a 2pe'i#i' !ile in Command Prompt
A) !n the co""and pro"pt, type the co""and below and press enter.
NTE: Substitute Full Path of File with extension within quotes below with your files's full
path and name with the extension included within quotes instead.
Code&
DEL /F /S /Q /A "Full Path of File with extension"
NTE: For example if ! wanted to delete a text file named File with the file extension .txt
on my des"top ! would type this command below.
Code&
DEL /F /S /Q /A "C:\Users\UserName\Desktop\File.txt"
B) Go to step ''.
-. To 1elete 3ll !iles in a !older wit4o*t Con#irmation in Command Prompt
NTE: This will not as" you if it's o" (#$%) to delete each file when deletin& all files in a
folder and the folder's subfolders.
A) !n the co""and pro"pt, type the co""and below and press enter.
NTE: Substitute Full Path of Folder within quotes below with the full path of the folder
that you want to delete all files in.
Code&
DEL /F /S /Q /A "Full Path of Folder\*"
NTE: For example if ! wanted to delete all files in my D:\Projects folder and subfolders !
would type this command below.
Code&
DEL /F /S /Q /A "D:\Projets\*"
B) Go to step ''.
.. To 1elete 3ll !iles in a !older wit4 Con#irmation in Command Prompt
NTE: This will as" you if it's o" (#$%) to delete each file when deletin& all files in a folder
and the folder's subfolders.
A) !n the co""and pro"pt, type the co""and below and press enter.
NTE: Substitute Full Path of Folder within quotes below with the full path of the folder
that you want to delete all files in.
Code&
DEL /P /F /S /A "Full Path of Folder\*"
NTE: For example if ! wanted to delete all files in my D:\Projects folder and subfolders !
would type this command below.
Code&
DEL /P /F /S /A "D:\Projets\*"
B) Go to step ''.
/. To 1elete 3ll !iles wit4 a 2pe'i#ied !ile E"tension in a !older wit4o*t Con#irmation
in Command Prompt
NTE: This will not as" you if it's o" (#$%) to delete each file when deletin& all files with a
specified file extension in a folder and the folder's subfolders.
A) !n the co""and pro"pt, type the co""and below and press enter.
NTE: Substitute Full Path of Folder within quotes below with the full path of the folder
that you want to delete all files in. Substitute extension with the file extension of the type of
files that you want to delete in the folder and it's subfolders.
Code&
DEL /F /S /Q /A "Full Path of Folder\*.extension"
NTE: For example if ! wanted to delete all txt (text) files in my D:\Projects folder and
subfolders ! would type this command below.
Code&
DEL /F /S /Q /A "D:\Projets\*.txt"
B) Go to step ''.
10. To 1elete 3ll !iles wit4 a 2pe'i#ied !ile E"tension in a !older wit4 Con#irmation in
Command Prompt
NTE: This will as" you if it's o" (#$%) to delete each file when deletin& all files with a
specified file extension in a folder and the folder's subfolders.
A) !n the co""and pro"pt, type the co""and below and press enter.
NTE: Substitute Full Path of Folder within quotes below with the full path of the folder
that you want to delete all files in. Substitute extension with the file extension of the type of
files that you want to delete in the folder and it's subfolders.
Code&
DEL /P /F /S /A "Full Path of Folder\*.extension"
NTE: For example if ! wanted to delete all txt (text) files in my D:\Projects folder and
subfolders ! would type this command below.
Code&
DEL /P /F /S /A "D:\Projets\*.txt"
11. (he file(s) should now be deleted.
12. Close the co""and pro"pt.
NTE: !f you used a command prompt at boot then also close the System Recovery Options
window and restart the computer.
temp s4own 4idden #ile
path&) attrib *s *h +s +d ,.,

Vous aimerez peut-être aussi