Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Command Prompt - Windows 11, 10, etc. ► ««« »»»

Secure File Removal Using the ERASE Command, Examples?


Please use Eraser to delete sensitive data. It can also clean digital SD memory cards of all recoverable data!



As with Linux, Appel's Mac OS and other systems like Android, Microsoft Windows 11, 10, ... and MS Server OS has programs to safely delete data. There are handy programs, such as free Windows Safe Delete tool.

But if you want to do this important task with cmd.exe, you will find helpful tips and examples here. PS: The command program ERASE is often used by administrators on Windows Server systems, but you can also test it for yourself.
 

Content:

1.) ... The deletion under Windows with the command ERASE examples! 
2.) ... Where is the advantage when deleting about Windows command ERASE? 
3.) ... What should I pay attention to when using the ERASE command?




1.) The deletion under Windows with the command ERASE examples! 


Example 1:

At the command prompt, type the following command, press Enter!


ERASE / F / S / Q / A "C:\Windows\System32\calc.exe"
C:\Windows\System32\calc.exe
Access denied
 


Tip: You can use X any full path to the quoted extension file, even if there are spaces!
 
Example 2:

To delete all files in a folder without confirmation in the command prompt 


ERASE C:\Windows\System32>ERASE /F /S /Q /A "C:\delete\*"
File was deleted  - C:\delete\test.zip
File was deleted  - C:\delete\test.xls
File was deleted  - C:\delete\test.doc
 
C:\Windows\System32>

 

Example 3:

To delete all files with a given file extension in a folder with confirmation in prompt, for example, delete all Microsoft Excel files in a folder.  


C:\Windows\System32>ERASE /P /F /S /A "C:\Importantfolder\*.xls"
Do you want to delete "C: \ Importantfolder \ Private.xls" (Y / N)? y
File deleted - C:\Importantfolder\Private.xls
Do you want to delete "C:\Importantfolder\Security.xls" (Y / N)? y
File was deleted - C:\Importantfolder\Security.xls
Do you want to delete "C:\Importantfolder\Important.xls" (Y / N)? y
File deleted - C:\Importantfolder\Important.xls
 
C:\Windows\System32>

Tip:
Wildcards can be used to delete multiple files. If a directory is specified, all files in this directory will be deleted! 
 
Parameter von ERASE man kann mit einem Test-Ordner ein wenig experimentieren!

/P Prompts you for confirmation before deleting each file.
/F Forces deletion of read-only files.
/S Deletes all files in all subdirectories.
/Q No query when using global placeholders.
/A  Selects the files to be deleted by the attribute.

Attributes: 
R  Read-only files 
S  System files
H  Hidden files 
A  Files to archive
I   Unindexed files 
L  Analysis points
 
         

2.) Where is the advantage when deleting about Windows command ERASE? 

Especially with external drives, you can specifically delete certain file extensions. And the deletion confirmation is also handy, not accidentally delete important files.

If you remove a document or an app on your Windows PC, you will find that it has been moved directly to the Recycle Bin, and / or not deleted, especially if you do not see a deletion confirmation dialog before, the deletion is not a real delete action.

If you want to prevent others to restoring important secure data from the Recycle Bin , it's a good idea.

3.) What should I pay attention to when using the ERASE command?

But beware!
Wildly deleting files or folders is not recommended, especially without the necessary knowledge.

See also:
►►  ... unlock (protected) files or delete them! 
►►  ... Secure deletion of files for more protection! 

 


FAQ 40: Updated on: 23 May 2024 17:22 Windows
Windows-Console

Using SCHTASK for Programs Autostart in all Windows OS, how to?


Time controlled Autostart of Windows 11, 10, etc. programs In new Windows OS you can use SCHTASK to start programs at a certain time   Content: 1.
Windows-Console

Redirect CMD command output to a file, with an example?


Use redirection operators to redirect or save the results of a command prompt in a file on MS Server OS or Windows 11, 10, As with MAC OS and Linux,
Windows-Console

Create multiple guest accounts on Windows 11, 10, 8.1, MS Server with commands?


It is very easy to create multiple guest accounts for guest users under Windows 11 / 10 / 8.1 / 7, or Windows Server by using command lines It is not only
Windows-Console

Check if there is a file path via PowerShell?


The solution is very simple to use a command in PowerShell to check whether a file path or folder path is available The solution is very simple with the test-path command,
Windows-Console

Use batch file to start multiple programs on Windows 11, 10...!


Start several programs at the same time via a batch file in order to save several clicks, is very popular on MS Windows 11, 10, desktop and server operating
Windows-Console

How do I force a logoff via command line, Windows 11, 10, 8.1, .. and MS Server?


The solution is very simple, to force that the logoff is carried out via the command line under Microsoft Windows 11 / 10 / 8.1 / 7 If some programs have
Windows-Console

Create bootable USB stick with Windows, but how?


Creating a bootable USB stick as an installation medium for Windows is no magic Everyone comes to this point and wants a solution that is very simple to

»»

  My question is not there in the FAQ
Asked questions on this answer:
  1. Is it possible to prevent data recovery after deletion using ERASE?
  2. How do I delete a file with a read-only attribute?
  3. What steps are necessary to delete a file using ERASE without receiving confirmation?
  4. How do I use wildcards to delete multiple files with ERASE?
  5. How do I stop ERASE from asking for confirmation when deleting files?
  6. Can ERASE also be used to clean digital SD memory cards?
  7. What should I keep in mind when using the ERASE command for the first time?
  8. What parameters can I use with the ERASE command to securely delete files?
  9. How can I ensure that important files are not accidentally deleted using ERASE?
  10. How do I delete all files in a directory including all subdirectories?
  11. How to delete all Excel files in a specific folder using ERASE?
  12. How do I delete all files with “not indexed” attribute in a specific folder?
  13. How to delete read-only files using ERASE command?
  14. Can I delete hidden files using ERASE? If yes how?
  15. What does the /A parameter mean in the ERASE command?
  16. Can I delete system files using ERASE command?
  17. How do I delete all files in a folder with a .txt extension?
  18. Which attributes can I use with the ERASE command to specifically delete files?
  19. Are there differences in the behavior of the ERASE command on different versions of Windows?
  20. What happens if I use the ERASE command without parameters?
  21. How do I use the ERASE command to delete files on Windows?
  22. How to delete a hidden file in the directory using ERASE?
  23. What is the difference between the DEL and ERASE commands in cmd.exe?
  24. Can I use the ERASE command on external drives?
  25. Can ERASE be used on network drives to delete files?
  26. How do I integrate the ERASE command into a script to periodically delete files?
  27. What does the /F parameter mean in the ERASE command?
  28. How can I delete all files in a specific folder without confirmation?
  29. What does the /S parameter mean in the ERASE command?
  30. How to delete a file in the system directory using ERASE command?
  31. How do I delete all files in a folder that have a specific attribute?
  32. What are the advantages of the ERASE command compared to other erasure methods in Windows?
  33. Can I also use ERASE to delete files that are currently in use?
Keywords: windows, 11, 10, server, eleven, console, secure, file, removal, using, erase, command, examples, delete, sensitive, data, clean, digital, memory, cards, recoverable, Questions, Answers, Software




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + WinPing
  + GetPixelColor
  + StressMyPC
  + DesktopSnowOK
  + Delete.On.Reboot
  + IsMyTouchScreenOK
  + Print.Test.Page.OK
  + OpenCloseDriveEject
  + ColorConsole
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | gc24b | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu


► Export / convert only marked pages to PDF file!? ◄
► On Windows 8.1 and 10, how to open Quickly Ease of Access Center ? ◄
► Turn off the left desktop corner APP switcher in Windows 8.1 / 10 (screen, disable)! ◄
► Can the software prevent the monitor from turning off during an online meeting? ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....