self deleting files

June 14, 2010 at 19:50:09
Specs: Windows XP
Hi, I found the following code here:
@echo off
Type "file"
PING -n 1 -w "time" >NUL
DEL "file"
DEL "file"
DEL %0

1- how can I set "time" to for example to 5 minute or 36 hours?
2- is there anyway to link a batch file to another file: for example to force the window to copy a .pdf file with accompanying .bat file (which contains a code to delete the .pdf file)


See More: self deleting files

Report •

June 15, 2010 at 07:54:01
1. Use Microsoft Scheduler to run your Batch File.

2. Make it a self extracting ZIP file.

If I was doing it I would simply make a program that would install a scheduled task to execute a delete command on the path the file is located in.

Report •

August 18, 2010 at 06:39:05
There is only one way I know of to put a timer on your batch file viruses....
All you gotta do is type in -t (then put however long you want it to wait to execute... for example... -t 60). It goes in seconds so if you want two mins, type -t 120. After that finish out the code and begin the countdown for execution.

Report •

August 18, 2010 at 18:15:50
Oh man... I strongly recommend you don't let a batch file sit for hours to do a command. Nothing good will come of it.

The Ping will only work if you are connected to the internet, so if your internet fail during the night for some reason, so will your batch file.

I suggest you do what ace_omega said if you are still wanting to do this.

Report •

Related Solutions

Ask Question