1.

Solve : Delete File in specific time?

Answer»

How can I DELETE a .txt file created in a BATCH file after 3 seconds or so? Is it possible?Quote from: joedavis on March 30, 2009, 08:21:42 PM

C:\>TYPE del3sec.bat
Code: [Select]@echo off
dir > textfile.txt
type textfile.txt
SLEEP 3
del textfile.txt
type textfile.txt

i didn't know there is sleep command/exe in nt dos.
C:\>sleep
'sleep' is not recognized as an internal or external command,
operable program or batch file.

to delay in nt dos, something that come close to it
C:\>ping -n 3 localhost>nul

for more accurate delay, use vbscript:
wsh.sleep 3000"sleep" is in the windows RESOURCE kit.


http://www.activexperts.com/activmonitor/windowsmanagement/reskit2000/0035/


Discussion

No Comment Found