How to set an expiration date based on the first date of running batch

Amin Muhammad 1 Reputation point
2022-09-16T15:03:13.483+00:00

Can I make a file that has a variable expiration date depending on the date it was run, for example,
for I want to make my batch expire after one month from the date it was run Or I must use a fixed expiration date stored inside the variable in the batch? but I'm asking to do this by "batch script" file, not as a "power shell"
Please help if you can as my batch programming is not good

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,642 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 46,551 Reputation points
    2022-09-16T15:44:31.23+00:00

    You've heard about this "web search" thing, right? Have you used to look for help or an example of what you want to do?

    Seriously, I just looked for "dos bat file remove file older than 30 days" and there are so many examples of how this is done! It's amazing!!!! You should try it!!!!!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.