[<<]Message[>>]    [<<]Author[>>]    [<<]Subject        [<<]Thread    

Number : 4783 Date : 2003-06-10 Author : Garry Deane Subject : Re: Removing unneeded files Size(KB) : 2
--- In xxcopy@yahoogroups.com, "rgen248x" wrote: > To Gary; > Your method works if used in a separate bat file. > It appears that the LMOD program ends the batch file. > This is a problem with my complete backup Bat program. Actually it's just that the final line branches to delbin.bat rather than CALLing delbin.bat. I hadn't really intended the batch to be used seriously but if you do want to use it, change the final line to: for %%a in (CALL DEL) do %%a delbin.bat > Your program can be reduced to two lines by eliminating > the CD line and the echo off line and moving the path > into the DIR command line. > I tried it and it did eliminate all but the latest file. Be wary. The CD command is necessary depending on where the batch file is located and how it is run as the recent posts on install.bat discuss. If you incorporated the code into you backup batch, it would probably be using a different current directory. The CD command can be eliminated but there is a likelihood that the LMOD line will then exceed 128 chars because the full path needs to be quoted twice in that line (in DIR and DEL). Alternately, since the UPDATES directory has no sub-directories (at least in my installation) you can use DIR /b/s.. to get the full path in %%a and keep the line to less than 128 characters. The echo off line is just a convenient way to initialise delbin.bat. It is necessary to either delete that file or clear its previous contents before appending the new DEL commands. The FOR command above deletes delbin.bat so this would make the "echo @echo off .." line unnecessary but a bit safer in case of an incomplete cleanup. The revised 2 line command would be: dir "c:\Program Files\Grisoft\AVG6\Update\*.bin" /a-d/o- d/b/s|lmod /L2-* del "[]" >> delbin.bat for %%a in (CALL DEL) do %%a delbin.bat > I plan on staying with the single XXcopy lie using D#30 > to limit the files. Thanks for all the effort. I gained > a lot of interesting info. Is there really any need to keep any of these .BIN files? I haven't tested it but my understanding is that the .BIN files are only used when AVG is being updated. Thereafter, they don't get used. I think you could delete the lot without any ill effects. A 1 line DEL command - the shortest of all. Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.