Question:
how do you create a batch file to delete a file after a period of time?
Holodude
2006-06-23 22:13:45 UTC
can you incorperate the batch file into another file like a jpg file?
Three answers:
Kevin
2006-07-04 18:53:58 UTC
There are a number of ways to do this (generally),



1) Use task scheduler to call your batch file at a certain time

2) Have the batch file run in the background and waiting for a certain time to appear on the system clock

3) Have the batch file countdown or wait a specified amount of time

4) Have the batch file do a directory listing of a given file or files and do a comparison or a 'find' for a particular date and time

5) Use the MS robocopy command to delete files of a certain age



..and so on.



If you were to give more details of exactly what you are trying to accomplish, we might be able to customize a solution for you.
ccfsr1
2006-06-23 22:33:34 UTC
Yes .With the introduction of Microsoft Windows 98, Microsoft has included Scheduled Tasks, a software program designed to run any program, including batch files, at any time or any schedule you desire. To run Scheduled Tasks, follow the below steps.



Click Start

Click Programs

Click Accessories, System Tools, and then Scheduled Tasks.

Once open, you'll be able to create your own custom task by clicking Add Scheduled Task, which will start you through the wizard, prompting you with what program you wish to execute, how often you wish to run it (daily, weekly, monthly, one time only, when my computer starts, and when I log on), the time you wish to run, and how often each day to run.

Not a .jpg but you can write it into the autoexec.bat file. You can make batch files that can write themselves into autoexec.bat by opening a .bat or .exe that you create.
?
2017-03-02 11:15:33 UTC
Batch File Countdown


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...