gpt4 book ai didi

scripting - 如何编写批处理文件以按时间删除文件夹和文件?

转载 作者:行者123 更新时间:2023-12-04 07:09:19 25 4
gpt4 key购买 nike

精确复制:

  • How to write a batch file to delete the files which are 5 days or older from a folder?
  • write a batch file to delete 6 days older files from a folder
  • write a batch file to delete 5 daya older files from a folder
  • How do I create a batch script that will delete a folder on a scheduled basis?
  • write a batch file to remove the folders by date and time wise.
  • write a script to delete files from a folder which are 5 days older than current date

  • 我想写一个批处理文件来按时删除文件夹、子文件夹和临时文件。
    条件是这样的:
  • 我需要在当前运行时间前一小时从文件夹中删除文件。
  • 我想从系统中获取当前时间并删除文件前一小时
  • 文件格式是这样的:<file name> <date>
  • 时间格式为 dd-mm-yyyy-hh-mmdd-mm-yy-hh-mm
  • 最佳答案

    Batch 可能非常强大,但我认为您想要的那种日期操作并不实用。

    您可以使用 FOR将日期拆分为元素,然后使用 SET /A做减法,但是你将需要大量的 IFGOTO处理诸如从 1 月 1 日午夜半减去一个小时之类的情况的语句。

    我认为你最好调查一下 VBSPowershell .

    关于scripting - 如何编写批处理文件以按时间删除文件夹和文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/625613/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com