|
Answer» thankx "ghostdog74" i'll fine out the error and i'll tell you 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?
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.. 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 advanceQuote strFolder=" S:\out" Try removing the space before the S:\outQuotethe 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.
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
|