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

Author Topic: Batch file to read date & time of text file & compare with Current  (Read 5079 times)

0 Members and 1 Guest are viewing this topic.

Yogesh123

    Topic Starter


    Beginner

    Batch file to read date & time of text file & compare with Current
    « on: September 09, 2009, 12:39:38 AM »
    Dear,
    How do i create batch file to read date & time of text file & compare with Current date & time to findout the difference between time & date.
    Procedure required,
    1) Read todays data & current time
    2) Read contents of txt file which are date & time
    3) compare step 1 with step 2
    4) if difference is greater than 8 hrs kill the process called xyz.

    please help me to solve.
    thanx in advance

    gh0std0g74



      Apprentice

      Thanked: 37
      Re: Batch file to read date & time of text file & compare with Current
      « Reply #1 on: September 09, 2009, 03:00:04 AM »
      if you can use vbscript,
      for 1) to 3) , you can see here for some examples... using Date (eg DateAdd,Datediff) functions from vbscript.
      for 4), you can see here


      Yogesh123

        Topic Starter


        Beginner

        Re: Batch file to read date & time of text file & compare with Current
        « Reply #2 on: September 09, 2009, 04:21:25 AM »
        Sorry but i am not much familiar with VB scripts.
        can we do the same by using batch file only.

        gh0std0g74



          Apprentice

          Thanked: 37
          Re: Batch file to read date & time of text file & compare with Current
          « Reply #3 on: September 09, 2009, 08:40:33 AM »
          Sorry but i am not much familiar with VB scripts.
          can we do the same by using batch file only.
          if you are asking for a batch solution here, it shows you are not familiar with batch either. what makes you hesitate to learn about vbscript then? you are also expected to put in your own effort in the first place.