Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Batch file suggestions?
Message
From
25/05/2006 16:18:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/05/2006 15:33:44
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
01125021
Message ID:
01125048
Views:
16
>I have a client with a W2K Server. They have the Trend Micro OfficeScan product installed on its system (C:) drive. This product downloads large (~17MB/day) virus definition files to a specific folder on C:.
>
>Trouble is, they don't have a lot of free space on C:, so within a couple of months their C: drive fills and their server crashes. It would be nice if Trend would clean up old definition files itself but it doesn't seem to do so.
>
>My first thought was to create a batch file that deletes all of the definition files and schedule it to run periodically. The only trouble is that for the virus definition update process to work properly, the *last* definition file must be present e.g.
>
>LPT$VPN.456
>LPT$VPN.457
>LPT$VPN.458
>...
>LPT$VPN.473
>LPT$VPN.474
>LPT$VPN.475  <-- Latest one, this file must not be deleted
>
>It's simple to make a batch file that deletes *all* of the update files, but much more challenging to write one that deletes all of them except for the very last one.

Could be feasible in a batch file, but why bother?
n=Adir(aVpn, "lpt*.*")
asort(aVpn)
for i=1 to n-4      && leave the last five
   if isdig(justext(aVpn[i,1])
      erase (aVpn[i,1])
   endif
endif
Build an exe out of this, schedule it to run an hour after the download, and sleep well :).

You may add some fullpath() handling, if you don't want the exe to reside in the same directory.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform