I am retiring this website. Please visit my new blog here for all things tech-related: goo.gl/d7D1J

Friday, April 10, 2009

Batch - Delete Files

In my example, the batch file will delete a file called "file.txt" on my computer's desktop. Be careful though, because it can delete about any file you designate in the script.

1. Open Notepad
2. Type:

@echo off
del "Path of the file" /Q /S> nul


Save as whatever.bat

Example:
@echo off
del "C:/Documents And Settings/User/Desktop/file.txt" /Q /S> nul

No comments:

Post a Comment

Web Analytics