#8293 - 2001-04-26 12:50 AM
Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
Does anyone have code to delete OLD .VDB Norton virus patterns from users hard drives? These files take up a lot of space on user hard drives and I need code to delete all files except the latest pattern.
|
Top
|
|
|
|
#8295 - 2001-04-27 02:44 AM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
The files are located under the following path:d:\program files\nav\ There are four files: VD0CEE21.VDB dtd 3/23 VD0CF617.VDB dtd 3/27 VD0D0603.VDB dtd 4/3 VD0D1826.VDB dtd 4/12 Each of the files are over 3,000 MB which hogs space on the users hard drive. I want to be able to delete the first three files and keep the most recent file on all users hard drives.
|
Top
|
|
|
|
#8296 - 2001-04-27 10:56 PM
Re: Removing Norton Anti-Virus .vdb Files
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
StanAre you sure that these files has something to do with Norton antivirus. My virus patterns for Norton antivirus has the size of about 5 MB, ver 5.0 to 7.5 You have four files at 3000MB, that is 12 GigaBytes???? What version of Norton antivirus are you using? Even a server version should be ashamed to use the kind of space your desktops are using Have you made some sort of export of the installation routines to all desktops?
|
Top
|
|
|
|
#8299 - 2001-04-29 10:51 PM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
|
Top
|
|
|
|
#8301 - 2001-04-30 02:46 AM
Re: Removing Norton Anti-Virus .vdb Files
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,We create following script:
code:
$path="d:\Program Files\nav\*.vdb" ; <-- change be changed to other filenames $temp_file="%temp%\kixtart.tmp" ; del $temp_file shell "%comspec% /c dir "+$path+" /o:d /b /s >"+$temp_file shell "%comspec% /c echo ~~~completed~~~ >>"+$temp_file IF (Exist($temp_file) = 1) IF (Open(1,$temp_file) = 0) $file=ReadLine(1) $file_prev=$file IF (INSTR($file,"~~~completed~~~") <> 0) $completed="yes" ELSE $completed="no" ENDIF WHILE ($completed <> "yes") $file=ReadLine(1) IF (INSTR($file,"~~~completed~~~") = 0) IF (GetFileTime($file) > GetFileTime($file_prev)) ? " delete "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" IF (SetFileAttr($file_prev, 32) <> 0) ? "Error "+$error+": "+@serror ENDIF del $file_prev $file_prev=$file ELSE ? " delete "+$file+" ("+GetFileTime($file)+" "+GetFileSize($file)+" bytes)" IF (SetFileAttr($file, 32) <> 0) ? "Error "+$error+": "+@serror ENDIF del $file ENDIF ELSE $completed="yes" ENDIF LOOP ? IF (INSTR($file_prev,"~~~completed~~~") = 0) ? " most recent file = "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" ELSE ? " no file '"+$path+"'" ENDIF ENDIF ENDIF del $temp_file
With $path="T:\*.html" we see the following information:
code:
delete t:\002200.html (2001/04/29 22:06:26 20022 bytes) delete t:\002204.html (2001/04/29 22:13:25 20561 bytes) delete t:\001598.html (2001/04/29 22:14:15 17062 bytes) most recent file = t:\001590.html (2001/04/29 22:14:22 11782 bytes)
The temporary file looks like:
code:
t:\002200.html t:\002204.html t:\001598.html t:\001590.html ~~~completed~~~
Second run will be
code:
most recent file = t:\001590.html (2001/04/29 22:14:22 11782 bytes)
By an empty directorie for specified file
code:
no file '*.html'
Greetings.
|
Top
|
|
|
|
#8302 - 2001-04-30 02:58 PM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
MCA,Thanks for the reply. I get the following error message when I attempt to run this script. Any suggestions? Error - Abnormal program termination, exit code: 1(0x01)
|
Top
|
|
|
|
#8303 - 2001-05-01 02:55 AM
Re: Removing Norton Anti-Virus .vdb Files
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,We suppose that during the copy action something is going wrong. Code without debug info:
code:
$path="d:\Program Files\nav\*.vdb" ; <-- change be changed to other filenames $temp_file="%temp%\kixtart.tmp" ; del $temp_file shell "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file shell "%comspec% /c echo ~~~completed~~~ >>"+$temp_file IF (Exist($temp_file) = 1) IF (Open(1,$temp_file) = 0) $file=ReadLine(1) $file_prev=$file IF (INSTR($file,"~~~completed~~~") <> 0) $completed="yes" ELSE $completed="no" ENDIF WHILE ($completed <> "yes") $file=ReadLine(1) IF (INSTR($file,"~~~completed~~~") = 0) IF (GetFileTime($file) > GetFileTime($file_prev)) ? " delete "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" IF (SetFileAttr($file_prev, 32) <> 0) ? "Error "+$error+": "+@serror ENDIF del $file_prev $file_prev=$file ELSE ? " delete "+$file+" ("+GetFileTime($file)+" "+GetFileSize($file)+" bytes)" IF (SetFileAttr($file, 32) <> 0) ? "Error "+$error+": "+@serror ENDIF del $file ENDIF ELSE $completed="yes" ENDIF LOOP ? IF (INSTR($file_prev,"~~~completed~~~") = 0) ? " most recent file = "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" ELSE ? " no file '"+$path+"'" ENDIF ENDIF ENDIF del $temp_file
The line:
code:
shell "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file
is extended with the CHR(34) characters for handling long filenames.To trace a possible problem we have include a debug version of above code.
code:
del "c:\kixtart.txt" IF RedirectOutput("c:\kixtart.txt") ENDIF?"- 1-" ?"- 2-" $path="d:\Program Files\nav\*.vdb" ; <-- change be changed to other filenames ?"- 3-" $temp_file="%temp%\kixtart.tmp" ?"- 4-" ; ?"- 5-" DEL $temp_file ?"- 6-" SHELL "%comspec% /c dir "+CHR(34)+$path+CHR(34)+" /o:d /b /s >"+$temp_file ?"- 7-" SHELL "%comspec% /c echo ~~~completed~~~ >>"+$temp_file ?"- 8-" IF (Exist($temp_file) = 1) ?"- 9-" IF (Open(1,$temp_file) = 0) ?"- 10-" $file=ReadLine(1) ?"- 11-" $file_prev=$file ?"- 12-" IF (INSTR($file,"~~~completed~~~") <> 0) ?"- 13-" $completed="yes" ?"- 14-" ELSE ?"- 15-" $completed="no" ?"- 16-" ENDIF ?"- 17-" WHILE ($completed <> "yes") ?"- 18-" $file=ReadLine(1) ?"- 19-" IF (INSTR($file,"~~~completed~~~") = 0) ?"- 20-" IF (GetFileTime($file) > GetFileTime($file_prev)) ?"- 21-" ? " delete "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" ?"- 22-" IF (SetFileAttr($file_prev, 32) <> 0) ?"- 23-" ? "Error "+$error+": "+@serror ?"- 24-" ENDIF ?"- 25-" DEL $file_prev ?"- 26-" $file_prev=$file ?"- 27-" ELSE ?"- 28-" ? " delete "+$file+" ("+GetFileTime($file)+" "+GetFileSize($file)+" bytes)" ?"- 29-" IF (SetFileAttr($file, 32) <> 0) ?"- 30-" ? "Error "+$error+": "+@serror ?"- 31-" ENDIF ?"- 32-" DEL $file ?"- 33-" ENDIF ?"- 34-" ELSE ?"- 35-" $completed="yes" ?"- 36-" ENDIF ?"- 37-" LOOP ?"- 38-" ? ?"- 39-" IF (INSTR($file_prev,"~~~completed~~~") = 0) ?"- 40-" ? " most recent file = "+$file_prev+" ("+GetFileTime($file_prev)+" "+GetFileSize($file_prev)+" bytes)" ?"- 41-" ELSE ?"- 42-" ? " no file '"+$path+"'" ?"- 43-" ENDIF ?"- 44-" ENDIF ?"- 45-" ENDIF ?"- 46-" DEL $temp_file
The file c:\kixtart.txt will contain the debug output. An example of this file can be:
code:
- 1- - 2- - 3- - 4- - 5- - 6- - 7- - 8- - 9- - 10- - 11- - 12- - 13- - 14- - 17- - 38-- 39- - 42- no file 'd:\Program Files\nav\*.vdb' - 43- - 44- - 45- - 46-
When you will get the same message you can see which line procedure that message. By email will I send you both files. So a possible disruption will be prevented.Greetings.
|
Top
|
|
|
|
#8304 - 2001-05-01 02:58 AM
Re: Removing Norton Anti-Virus .vdb Files
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
We can find your email address. Please send it to us.
|
Top
|
|
|
|
#8306 - 2001-05-01 02:53 PM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
I still get the following error message:Command Line: D:\Projects\Kixtart Scripting\kix32.exe /d "D:\Projects\Kixtart Scripting\Board\nav-debug.kix" Error - Abnormal program termination, exit code: 1(0x01) I'm running version 2.0 (which may be the problem) Which version should I download?
|
Top
|
|
|
|
#8308 - 2001-05-03 03:04 PM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
MCA,I'm running Windows 2000, and version 2.0 of Kixtart.
|
Top
|
|
|
|
#8310 - 2001-05-16 02:06 AM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
MCA,Here's the results of the debug script. 20-Script error : expected expression !. ?"- 20-" IF (GetFileTime($file) > GetFileTime($file_prev)
|
Top
|
|
|
|
#8311 - 2001-05-16 02:21 AM
Re: Removing Norton Anti-Virus .vdb Files
|
Anonymous
Anonymous
Unregistered
|
Here are the result of the debug query you sent. Sorry I'm just now replying, however it's been kinda hectic around here. Thanks!- 1- - 2- - 3- - 4- - 5- - 6- - 7- - 8- - 9- - 10- - 11- - 12- - 15- - 16- - 17- - 18- - 19- - 20-Script error : expected expression !. ?"- 20-" IF (GetFileTime($file) > GetFileTime($file_prev))"
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 153 anonymous users online.
|
|
|