Home / Microsoft / Microsoft DOS / COMPARE DATE MODIFIED WITH CURRENT DATE
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 [2]  All - (Bottom) Print
Author Topic: COMPARE DATE MODIFIED WITH CURRENT DATE  (Read 13413 times)
MISS VIP
Topic Starter
Rookie



Posts: 11


« Reply #15 on: July 13, 2008, 03:48:21 AM »

thankx "ghostdog74" i'll fine out the error and i'll tell you
IP logged
Dias de verano
Guest
« 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?


IP logged
MISS VIP
Topic Starter
Rookie



Posts: 11


« 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..
IP logged
MISS VIP
Topic Starter
Rookie



Posts: 11


« 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
IP logged
Dias de verano
Guest
« 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 » IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,342

Experience: Familiar
OS: Windows 7

« 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)
IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
ALAN_BR
Hopeful



Thanked: 5
Posts: 346


« 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 
IP logged

Acer Laptop TravelMate 244LM. 1.25 GB Ram + 160 GB HDD. C:\ = 20 GB.
Windows XP Home Edition with SP3; Acronis T.I. 11.0 (build*8,101);
Protection ESET NOD32 v 2.7 Antivirus plus Comodo Firewall 3.5.
PerfectDisk 2008 v 9.0.0.64; Partition Wizard
EasyBcd Dual Boot, Default XP, W7 if I really have to
Pages: 1 [2]  All - (Top) Print 
Home / Microsoft / Microsoft DOS / COMPARE DATE MODIFIED WITH CURRENT DATE « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.101 seconds with 19 queries.