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

Author Topic: COMPARE DATE MODIFIED WITH CURRENT DATE  (Read 31247 times)

0 Members and 1 Guest are viewing this topic.

MISS VIP

    Topic Starter


    Rookie

    Re: COMPARE DATE MODIFIED WITH CURRENT DATE
    « Reply #15 on: July 13, 2008, 03:48:21 AM »
    thankx "ghostdog74" i'll fine out the error and i'll tell you

    Dias de verano

    • Guest
    Re: COMPARE DATE MODIFIED WITH CURRENT DATE
    « Reply #16 on: July 13, 2008, 01:52:43 PM »
    Code: [Select]
    IF "%1" == "" S:\AISHA\MSG *.TXT   GOTO SER_DATE
    This line is nonsense.

    Also, if SER_DATE is a label, it should start with a colon.

    Code: [Select]
    C:\IN> cscript /nologo script.vbs
    Why is C:\IN> at the beginning? This will not work.

    Code: [Select]
    REM Execute the MS-DOS dir command ever 60 MIN.

    SLP
    SLEEP 60
    GOTO START

    What is SLP? A label? a program? Why is it there?

    Execute the dir command? Where? How?



    MISS VIP

      Topic Starter


      Rookie

      Re: COMPARE DATE MODIFIED WITH CURRENT DATE
      « Reply #17 on: July 13, 2008, 09:47:21 PM »
       hi Dias de verano ,

      the first code

       
      Code: [Select]
      IF "%1" == "" S:\AISHA\MSG *.TXT   GOTO SER_DATEit will go to aisha file in S drive and search only for text files. then it will go to ser_date command.

      Code: [Select]
      C:\IN> cscript /nologo script.vbs
      C:\IN is the name of the folder where i kept my script.vbs

      Code: [Select]
      REM Execute the MS-DOS dir command ever 60 MIN.

      SLP
      SLEEP 60
      GOTO START

      SLP is the name of the command if the previous code execute perfectly then it will go to SLP to sleep for 60 min then it eill go to start to start again..


      am i doing somthing wrong ?

      thankx for ur helps guys..

      MISS VIP

        Topic Starter


        Rookie

        Re: COMPARE DATE MODIFIED WITH CURRENT DATE
        « Reply #18 on: July 20, 2008, 04:16:10 AM »
        Code: [Select]
        N=Now
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        strFolder=" S:\out"
        strNewDest = "C:\IN"
        Set objFolder = objFSO.GetFolder(strFolder)
        For Each strFiles In objFolder.Files
              If DateDiff("d",N, strFiles.DateLastModified) >1  Then           
                    'objFSO.MoveFile strFiles , strNewDest & "\" & strFiles.Name
                        Wscript.Echo strFiles.Name
              End If
        Next


        i tried this VBS code .. it gave an error in the fifth line and the error is (path not found )?!

        the one is calculated as one day how can i convert it to min. ?

        thanks in advance

        Dias de verano

        • Guest
        Re: COMPARE DATE MODIFIED WITH CURRENT DATE
        « Reply #19 on: July 20, 2008, 04:47:17 AM »
        Quote
        strFolder=" S:\out"

        Try removing the space before the S:\out
        « Last Edit: July 20, 2008, 06:47:34 AM by Dias de verano »

        Sidewinder



          Guru

          Thanked: 139
        • Experience: Familiar
        • OS: Windows 10
        Re: COMPARE DATE MODIFIED WITH CURRENT DATE
        « Reply #20 on: July 20, 2008, 06:44:12 AM »
        Quote
        the one is calculated as one day how can i convert it to min. ?

        Do the arithmetic in minutes:

        Code: [Select]
        If DateDiff("n", strFiles.DateLastModified, Now) > 15 Then

        I think this was the original code. Something may have gotten lost in the translation.

         8)
        The true sign of intelligence is not knowledge but imagination.

        -- Albert Einstein

        ALAN_BR



          Hopeful

          Thanked: 5
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 7
          Re: COMPARE DATE MODIFIED WITH CURRENT DATE
          « Reply #21 on: September 01, 2008, 09:41:08 AM »
          There seems to be a fundamental flaw from the very first post.

          From the ambitions / intentions expressed in the comments it appears that :-
          a) Any recent file that is less than 15 minutes of age is to be archived;
          b) The above rule will exclude from archiving any thing created / altered in the next 45 minutes, unless the SLEEP period is reduced from 60 minutes down to 15.

          Regards
          Alan