Page 1 of 1 1
Topic Options
#7669 - 2001-03-21 09:33 PM Skips part of script
Anonymous
Unregistered


Could someone tell me why this is not working.The rest of the script runs properly bu it skips over this part.

$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

------------------

Top
#7670 - 2001-03-21 09:40 PM Re: Skips part of script
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
It's probably something higher up in your script... check for unmatched IF/ENDIF's or post all your code...

Shawn.

Top
#7671 - 2001-03-21 09:43 PM Re: Skips part of script
Anonymous
Unregistered


This is the only thing above it.

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

------------------

Top
#7672 - 2001-03-21 09:57 PM Re: Skips part of script
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What's not working ? Is the comparefiletimes() returning something odd or is the copy command not working... put debug statements in your code, check the value of @ERROR after your copy, or single step through your script by using the kix32.exe /d switch.

Shawn.

Top
#7673 - 2001-03-22 01:58 PM Re: Skips part of script
Anonymous
Unregistered


Just to clarify, is the code being skipped for just some machines or all of them. Your code should run the relevant section for all machines except TWEETY and MARVIN.

You might also have the script print the value of $Result, just so you know what it's being evaluated to. If all else fails you might try using the long path names instead of the short ones. I have had a few instances of odd behaviour with this kind of thing, although admittedly not with Kixtart.

Top
#7674 - 2001-03-23 02:54 AM Re: Skips part of script
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
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

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org