Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How do I create a batch file to delete log files older than 2 weeks????  (Read 20136 times)

0 Members and 1 Guest are viewing this topic.

billrich

  • Guest
Re: How do I create a batch file to delete log files older than 2 weeks????
« Reply #15 on: October 22, 2009, 07:04:17 PM »
Have a nice day.  :)
« Last Edit: October 23, 2009, 07:04:42 PM by billrich »

gh0std0g74



    Apprentice

    Thanked: 37
    Re: How do I create a batch file to delete log files older than 2 weeks????
    « Reply #16 on: October 22, 2009, 07:16:12 PM »
    Casper,
    May I ask how old you are and where you work?
    irrelevant and sorry, i don't like to feed trolls... you are on my ignore list until further notice.

    billrich

    • Guest
    Re: How do I create a batch file to delete log files older than 2 weeks????
    « Reply #17 on: October 22, 2009, 08:33:21 PM »
    Have a nice day. ;)
    « Last Edit: October 23, 2009, 07:03:49 PM by billrich »

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: How do I create a batch file to delete log files older than 2 weeks????
    « Reply #18 on: October 22, 2009, 10:38:20 PM »
    Billrich, your idea of "help" is simply copy-pasting from a command window the /? from a command that over half the time has nothing to do with the question at hand, and then the moment anybody points that out you call them things like "BC_hat" and "Casper" while meanwhile not actually adding either anything relevant to the situation, anything pertinent to WHY you think the /? is actually something useful (people are looking for some sort of human input, not autonomic replies they can get elsewhere) or even pointing out, in those cases where the command is even slightly related to the issue, WHAT switch is relevant. For example, somebody would ask how to sort files in a dir, or something. And you'd simply post the entire listing of the dir /? command, which, while containing the answer doesn't actually answer the question. May as well answer questions "what does the word <blank> mean" with a listing a dictionary.

    And in this instance, simply because Ghostdog refuses to answer your irrelevant questions to make broad assumptions about his occupation and age. He knows more about computers then you ever will, and helps more then you could ever hope. The only thing he learned today is that your posts are best ignored.


    Also, while the latest reply to the thread was in fact recent, the quote you replied to WAS three months old, and his conjecture about why you decided to reply to the three month old post rather then the more immediate questions posed (which I might add are even more removed from being a "pure DOS" solution then the ones ghostdog posted).

    And Lastly, The "Batch" board is for Batch files. Batch Files run on windows.

    A batch file is a series of commands. we all know this.

    NT has command extensions. These don't work in pure DOS batch.

    NT also, like other versions of windows, has commands such as CScript and WScript.

    Too not leverage these tools as one leverages the "find" or other DOS commands is to neglect to realize the purpose of batch is to make things easier, not to serve as a fully integrated environment. This is why we HAVE the DOS programs such as find, and more, that are used with many versions of MS-DOS. the Windows Scripting Host is available on Windows 98, ME, 2000, XP, Vista, and 7. To neglect solutions that use the scripting host on the basis that they are not "pure batch" is ludicrous, because they work. Batch is, as ghostdog said, limited when it comes to dates. It sucks. The date processing is limited to context sensitive string processing that requires a knowledge of the specific date separators available on the machine. VBScript actually has a Date data type and functions that deal with the dates in a way that is actually localizable to more then one regional date format.
    I was trying to dereference Null Pointers before it was cool.

    gh0std0g74



      Apprentice

      Thanked: 37
      Re: How do I create a batch file to delete log files older than 2 weeks????
      « Reply #19 on: October 22, 2009, 11:37:44 PM »
      @BC, you write eloquently and its a great post. I would suggest you don't bother about it next time.  Your time can be used productively elsewhere

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: How do I create a batch file to delete log files older than 2 weeks????
      « Reply #20 on: October 23, 2009, 09:07:36 AM »
      @BC, you write eloquently and its a great post. I would suggest you don't bother about it next time.  Your time can be used productively elsewhere

      so true.
      I was trying to dereference Null Pointers before it was cool.

      billrich

      • Guest
      Re: How do I create a batch file to delete log files older than 2 weeks????
      « Reply #21 on: October 23, 2009, 07:12:24 PM »



      BC,

      Thanks for the tips on how I can improve my posting  behaviour.

      I searched all of your old posts for batch files or code of any kind. I could find nothing.

      Your posts are not a good model of how to write code.

      But I suspect your are/were a good programmer supervisor.

      Why are your posts so long?

      Have a great day.   

      BatchFileBasics



        Hopeful

        Thanked: 18
        Re: How do I create a batch file to delete log files older than 2 weeks????
        « Reply #22 on: October 23, 2009, 08:39:17 PM »
        Bill,
        I searched all of your old posts for batch files or code of any kind. I could find nothing.

        Maybe because he focuses more on vb, c(++,# i don't know), and other more productive languages. surely you could notice that, or not, it seems you only like to nit pick as the bad things.

        Quote
        Your posts are not a good model of how to write code.

        as BC said, his posts are more stated than, open cmd - dir /? - copy paste.

        Quote
        Why are your posts so long?
        his posts are long because he actually makes points, and backs them up. besides saying "why" or 1 sentence explanations


        Have a great day.   
        When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.

        gh0std0g74



          Apprentice

          Thanked: 37
          Re: How do I create a batch file to delete log files older than 2 weeks????
          « Reply #23 on: October 23, 2009, 08:50:37 PM »
          I searched all of your old posts for batch files or code of any kind. I could find nothing.
          if BC or yours truly can find just 1 batch code that he posted, would you shut your trap from now on?

          billrich

          • Guest
          Re: How do I create a batch file to delete log files older than 2 weeks????
          « Reply #24 on: October 23, 2009, 09:34:04 PM »
          if BC or yours truly can find just 1 batch code that he posted, would you shut your trap from now on?

          Only if find ten or more and you reveal your age/

          gh0std0g74



            Apprentice

            Thanked: 37
            Re: How do I create a batch file to delete log files older than 2 weeks????
            « Reply #25 on: October 23, 2009, 09:59:33 PM »
            Only if find ten or more and you reveal your age/
            so now its ten... when you specifically mention you can't find any "batch or any code" from BC. I can simply find one that will make you shut your trap, and in the end, you are just simply the best bull out there.

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: How do I create a batch file to delete log files older than 2 weeks????
            « Reply #26 on: October 23, 2009, 10:59:24 PM »
            I recall posting a module for displaying the right-click menu by using IContextMenu3 from VB6...

            but I suppose that doesn't count as "other code..."

            Or maybe it was an attachment... don't remember where it was.

            A quick google search with site:computerhope.com "Icontextmenu2" found this though.

            http://www.computerhope.com/forum/index.php?topic=75905.0%3Ball

            That being said it was a discussion rather then a help request... However, it is still code.

            And there are a large number of scripts and so forth that I have posted. Google search and the old forum search are pretty easy to use.
            I was trying to dereference Null Pointers before it was cool.