Dear,

The manual tell us:

code:

COMPAREFILETIMES( )

Action: Compares the date and time of two files.
Syntax: COMPAREFILETIMES ("file1", "file2")
Parameters: File1
- Identifies the first file you want to compare.

File2
- Identifies the second file you want to compare.

Returns: -3 File2 could not be opened (see @ERROR for more information).
-2 File1 could not be opened (see @ERROR for more information).
-1 File1 is older than file2.
0 File1 and file2 have the same date and time.
1 File1 is more recent than file2.

Example: $Result = CompareFileTimes(@LDRIVE + "\USER.INI", "C:\WINDOWS\USER.INI")
IF $Result = 1 OR $Result = -3
COPY @LDRIVE + "\USER.INI" "C:\WINDOWS\USER.INI"
ENDIF


Your code:

code:

SETTIME \\TAZ
use g: /delete
use o: /delete
use p: /delete
use j: /delete
use h: /delete
use i: /delete
IF @WKSTA="TWEETY" OR @WKSTA="MARVIN"
goto next
ELSE
$Result = CompareFileTimes(@LDRIVE + "\newdat\scan.dat", "c:\progra~1\common~1\networ~1\viruss~1\4.0.xx\scan.dat")
IF $Result = 1 OR $Result = -3
COPY @LDRIVE + "\scan.dat" "c:\progra~1\common~1\networ~1\viruss~1\4.0.xx\scan.dat" /h
ENDIF
; ....
ENDIF
; ....
:next

can have the following problems:


  • statement: use g: /delete may abort the script when this
    mappings doesn't exist
    solution: if (exist("g:\nul") <> 0)
    use g: /delete
    endif
  • statement: $result=... result unknown.
    solution: add statement ? $result
  • statement: copy .... isn't always possible. problem can be
    share violation error or busy error error.
    solution 1: McAfee scanner may not be active during copy activities.
    solution 2: run superdat update, which file is distirubted by
    McAfee and which update will automatically stop, update
    and start McAfee virus scanner.

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA