Question

  • Creator
    Topic
  • #2213773

    self deleting files, setting a delay time

    Locked

    by Anonymous ·

    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

All Answers

  • Author
    Replies
    • #2868979

      Clarifications

      by Anonymous ·

      In reply to self deleting files, setting a delay time

      Clarifications

    • #2868942

      ?

      by seanferd ·

      In reply to self deleting files, setting a delay time

      -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.

    • #2868929

      Easy one. Used to use it myself.

      by neilb@uk ·

      In reply to self deleting files, setting a delay time

      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.

      😀

Viewing 2 reply threads