Writing a self deleting batch file

Some people laugh at me when I tell them I love to write batch files.Thinking

Today i found myself in kinda a pickle, I wanted to write a batch file that would delete itself as well as any files in the directory it was located in. So I turned to my good friend Google, not too much luck… Lucky I can usually figure this stuff out. Here’s what worked for me…

The solution:
@echo off
cls
del. /q

the del. deletes everything in the working directory and /q switch makes it so you don’t have to confirm every file delete (quite mode).

I hope this info was helpful!



Written by Brett Pierce - Visit Website

Tags: ,

One Response to “Writing a self deleting batch file”

  1. Kelly Brown Says:
    June 12th, 2009 at

    Hi, very nice post. I have been wonder’n bout this issue,so thanks for posting