erase (2024)

Edit

Share via

  • Article

Deletes one or more files. If you use erase to delete a file from your disk, you can't retrieve it.

Note

This command is the same as the del command.

Syntax

erase [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>del [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>

Parameters

ParameterDescription
<names>Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted.
/pPrompts for confirmation before deleting the specified file.
/fForces deletion of read-only files.
/sDeletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted.
/qSpecifies quiet mode. You are not prompted for delete confirmation.
/a[:]<attributes>Deletes files based on the following file attributes:
  • r Read-only files
  • h Hidden files
  • i Not content indexed files
  • s System files
  • a Files ready for archiving
  • l Reparse points
  • - Used as a prefix meaning 'not'
/?Displays help at the command prompt.

Remarks

  • If you use the erase /p command, you'll see the following message:

    FileName, Delete (Y/N)?

    To confirm the deletion, press Y. To cancel the deletion and to display the next file name (if you specified a group of files), press N. To stop the erase command, press CTRL+C.

  • If you disable command extension, the /s parameter will display the names of any files that weren't found ,instead of displaying the names of files that are being deleted.

  • If you specify specific folders in the <names> parameter, all of the included files will also be deleted. For example, if you want to delete all of the files in the \work folder, type:

    erase \work
  • You can use wildcards (* and ?) to delete more than one file at a time. However, to avoid deleting files unintentionally, you should use wildcards cautiously. For example, if you type the following command:

    erase *.*

    The erase command displays the following prompt:

    Are you sure (Y/N)?

    To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER.

    Note

    Before you use wildcard characters with the erase command, use the same wildcard characters with the dir command to list all the files that will be deleted.

Examples

To delete all the files in a folder named Test on drive C, type either of the following:

erase c:\testerase c:\test\*.*

To delete all files with the .bat file name extension from the current directory, type:

erase *.bat

To delete all read-only files in the current directory, type:

erase /a:r *.*

Related links

Feedback

Was this page helpful?

erase (2024)
Top Articles
Forex Factory | Forex markets for the smart money.
My Journey to Becoming a Validator on Ethereum 2.0 | Consensys
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 5716

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.