Question

Locked

self deleting files, setting a delay time

By abtahei ·
Hi
how can i set the time at below code to activate the self deleting batch file after some minute, hours or days;
@echo off
Type "file"
PING 127.0.0.1 -n 1 -w "time" >NUL
DEL "file"
DEL %0
EXIT

thanks

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

?

by seanferd In reply to self deleting files, sett ...

-w is just to set the timeout on the ping, in milliseconds. It has absolutely nothing to do with having a batch file WAIT until executing a command.

Collapse -

Easy one. Used to use it myself.

by neilb@uk In reply to self deleting files, sett ...

the "time" is in seconds for ping to wait for a reply. If you ping an unkown IP, and NOT - repeat, NOT - 127.0.0.1 (try 128.0.0.1), ping will wait for the specified number of seconds before continuing.

If you ping the local loopback, 127.0.0.1, ping will come back in 1ms regardless of your timeout value.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums