#19766 - 2002-04-12 12:23 AM
Search in a dir and getting the last new file
|
Noisy
Fresh Scripter
Registered: 2002-02-04
Posts: 6
|
I'm trying to let KIX search in a dir and getting the last sdat files in a variable
Dir: sdat4194.exe sdat4195.exe Sdat4196.exe
So it has to search in the dir and come up with the Sdat4196.exe.
I have try searching the topic but didn't not find an example...can anyone help me please!
Thanks
|
|
Top
|
|
|
|
#19768 - 2002-04-11 02:06 PM
Re: Search in a dir and getting the last new file
|
Noisy
Fresh Scripter
Registered: 2002-02-04
Posts: 6
|
I think it the best to get the numbers in the file
|
|
Top
|
|
|
|
#19773 - 2002-04-11 04:54 PM
Re: Search in a dir and getting the last new file
|
Noisy
Fresh Scripter
Registered: 2002-02-04
Posts: 6
|
Then this has to work...Right!!??!!
First look in the dir en pick the last Sdat file then compare this with the value in the reg if its the same then do nothing and if not then update...
$regPath="HKEY_LOCAL_MACHINE\SOFTWARE\" $SdatPath="\\server\McAfee\" $Sdat="sdat0000.exe"
$filer=dir($SdatPath + "SuperDAT\") do if "sdat"=substr($filer,1,4) and val(substr($filer,5,4))>val(substr($Sdat,5,4)) $Sdat=$filer endif $filer=dir() until @error
$sDATVer=SUBSTR($Sdat,5,4) $VS45DATValue = READVALUE($RegPath + "McAfee\VirusScan","szVirDefVer") $VS45DATNum = SUBSTR($VS45DATValue,5,4)
IF VAL($sDATVer) > VAL($VS45DATNum) GOTO "SuperDAT" ELSE GOTO "END" ENDIF
:SuperDAT RUN ($SdatPath + "SuperDAT\" + $sDAT + " /silent /prompt") GOTO "END"
:END [ 11 April 2002, 17:14: Message edited by: Noisy ]
|
|
Top
|
|
|
|
#19775 - 2002-04-12 08:48 AM
Re: Search in a dir and getting the last new file
|
Noisy
Fresh Scripter
Registered: 2002-02-04
Posts: 6
|
@sealeopard Thanks for the reply
@Lonkero It is working and thanks for helping me out!
@Rocco Capra Yes i would like to see that script!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 869 anonymous users online.
|
|
|