As a precaution, you'll notice that the COMMAND variable currently
contains 'echo del' ... this is to prevent you from inadvertently
testing it and deleting a large number of files. Once you're
comfortable that it functions as you'd expect, edit the file and the
line -
set COMMAND=echo del
.... with ...
set COMMAND=del
Let me know if it works out for you.
--
Dean Wells [MVP / Directory Services]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l
Ben Rum wrote:
> Hi Dean, I couldn't get the command working. See the command prompt
> output below
>
> Also, I actualy simplified the scenario in my original post, I
> actually want to delete files which are named with a date prefix:
> i.e. 20050105_EXPORT.zip and so on.. I want to be able to delete
> files which are dated older than 14 days. So the first letter isn't
> quite enough for what I am looking for.
>
> I can easily produce the date part of the command via the SQL tool
> (i.e "del 20050105_EXPORT.zip") so if today is 20050822, I can easily
> produce "del 20050807*.zip" but it's the less than part I can't do...
>
> [from command prompt window]
> E:\MAPPED\TESTING>DIR
> Volume in drive E is DATA
> Volume Serial Number is F034-FCD8
>
> Directory of E:\MAPPED\TESTING
>
> 22/08/2005 14:44 <DIR> .
> 22/08/2005 14:44 <DIR> ..
> 22/08/2005 14:33 0 AFILE.txt
> 22/08/2005 14:34 2,089 alphacmd.BAT
> 22/08/2005 14:33 0 BFILE.txt
> 22/08/2005 14:33 0 GFILE.txt
> 22/08/2005 14:33 0 YFILE.txt
> 22/08/2005 14:34 0 ZFILE.txt
> 6 File(s) 2,089 bytes
> 2 Dir(s) 21,488,177,152 bytes free
>
> E:\MAPPED\TESTING>ALPHACMD G
>
> Working ...
>
> del a /-p
> del b /-p
> del c /-p
> del d /-p
> del e /-p
> del f /-p
> del G /-p
>
> E:\MAPPED\TESTING>DIR
> Volume in drive E is DATA
> Volume Serial Number is F034-FCD8
>
> Directory of E:\MAPPED\TESTING
>
> 22/08/2005 14:44 <DIR> .
> 22/08/2005 14:44 <DIR> ..
> 22/08/2005 14:33 0 AFILE.txt
> 22/08/2005 14:34 2,089 alphacmd.BAT
> 22/08/2005 14:33 0 BFILE.txt
> 22/08/2005 14:33 0 GFILE.txt
> 22/08/2005 14:33 0 YFILE.txt
> 22/08/2005 14:34 0 ZFILE.txt
> 6 File(s) 2,089 bytes
> 2 Dir(s) 21,488,177,152 bytes free
>
> E:\MAPPED\TESTING>
>
>
>
>
>
> "Dean Wells [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I can only assume by alphabetically less than 'G' that you're
>> referring to the first character of the filename? If so, no, not
>> natively ... though it can be scripted ... the enclosed file
>> achieves precisely that (it is enclosed as, when pasted and posted,
>> the script becomes too fragmented and awkward to reconstruct). The
>> file has been renamed to a text file and needs its extension changed
>> to .BAT or .CMD. Should the enclosure be inaccessible to you,
>> please post back.
>>
>> --
>> Dean Wells [MVP / Directory Services]
>> MSEtechnology
>> [[ Please respond to the Newsgroup only regarding posts ]]
>> R e m o v e t h e m a s k t o s e n d e m a i l
>>
>> Ben Rum wrote:
>>> Is it possible to issue a DEL command which deletes files based on
>>> an alpabetical less than or greater than?
>>>
>>> Basically as follows: (delete all files which are alphabetically
>>> less than "G" for example)
>>> C:> DEL < G*.*
>>> or
>>> C:> DEL [a-f]*.*
>>>
>>> Anythig like that exist?
>>>
>>> Thanks,
|