PC Review


Reply
Thread Tools Rate Thread

A batch file to delete *.bak files from the Recycle Bin?

 
 
Bill in Co.
Guest
Posts: n/a
 
      4th Oct 2009
Can someone tell me how to do this? I want to simply run it to delete the
..bak files (using del *.bak) produced every time I compact the OE folders,
instead of having to do this manually each time (by selecting them each time
in the recycle bin, which is a hassle).

I know how to write the batch file, but the Recycle folder is a system
folder, and is apparently locked down so I can't ever get it to work. And
trying to remove the system attribute on the Recycler/Recyled folder doesn't
seem to work either (nor is it probably a good idea).


 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a
 
      4th Oct 2009

"Bill in Co." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can someone tell me how to do this? I want to simply run it to delete
> the .bak files (using del *.bak) produced every time I compact the OE
> folders, instead of having to do this manually each time (by selecting
> them each time in the recycle bin, which is a hassle).
>
> I know how to write the batch file, but the Recycle folder is a system
> folder, and is apparently locked down so I can't ever get it to work.
> And trying to remove the system attribute on the Recycler/Recyled folder
> doesn't seem to work either (nor is it probably a good idea).


Deleting a file from the Recycled folder by means of a batch file is easy,
provided that you have appropriate privileges. However, there are two issues
that are more serious:
- Interfering with this folder is likely to corrupt the Recycle Bin.
- Deleted files are not stored under their original names but under some
artificial name. The link between the two names appears to be stored in a
filed called INFO2 which is also kept in the this folder. Extracting the
original name from INFO2 does not seem to be straightforward.

In view of the above I suggest you drop the idea. If the OE backup files
cause your disk to get full to capacity then it's time to buy a larger disk.


 
Reply With Quote
 
Bill in Co.
Guest
Posts: n/a
 
      5th Oct 2009
~BD~ wrote:
> On 04/10/2009 22:22, Bill in Co. wrote:
>> Can someone tell me how to do this? I want to simply run it to delete
>> the
>> .bak files (using del *.bak) produced every time I compact the OE
>> folders,
>> instead of having to do this manually each time (by selecting them each
>> time
>> in the recycle bin, which is a hassle).
>>
>> I know how to write the batch file, but the Recycle folder is a system
>> folder, and is apparently locked down so I can't ever get it to work.
>> And
>> trying to remove the system attribute on the Recycler/Recyled folder
>> doesn't
>> seem to work either (nor is it probably a good idea).
>>
>>

> Whist waiting for someone to answer your question, would you please
> explain why you don't simply wish to 'empty' your recycle bin like
> normal folk do?
>
> Thanks
>
> --
> Dave


Sure. Because I do it so often, and I have a few other files and/or
folders in there that I leave in there, in case I want them back, or for the
history. Selecting ONLY the *.bak ones all the time is a nuisance, when a
batch file can do it automatically.


 
Reply With Quote
 
Bill in Co.
Guest
Posts: n/a
 
      5th Oct 2009

Pegasus [MVP] wrote:
> "Bill in Co." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Can someone tell me how to do this? I want to simply run it to delete
>> the .bak files (using del *.bak) produced every time I compact the OE
>> folders, instead of having to do this manually each time (by selecting
>> them each time in the recycle bin, which is a hassle).
>>
>> I know how to write the batch file, but the Recycle folder is a system
>> folder, and is apparently locked down so I can't ever get it to work.
>> And trying to remove the system attribute on the Recycler/Recyled folder
>> doesn't seem to work either (nor is it probably a good idea).

>
> Deleting a file from the Recycled folder by means of a batch file is easy,
> provided that you have appropriate privileges.


I do - I'm the Administator and sole user of my computer.

> However, there are two issues
> that are more serious:
> - Interfering with this folder is likely to corrupt the Recycle Bin.


Not if I do it right. :-)

> - Deleted files are not stored under their original names but under some
> artificial name.


I can identify the file names, but my access to the folder in a batch file
to do such operations isn't working, that's all. You know, you get the
standard "not resetting the system attribute.." message, or whatever, when
you attempt it in the batch file.

> The link between the two names appears to be stored in a
> filed called INFO2 which is also kept in the this folder. Extracting the
> original name from INFO2 does not seem to be straightforward.


But again, I think I have access to the filenames ok.

> In view of the above I suggest you drop the idea. If the OE backup files
> cause your disk to get full to capacity then it's time to buy a larger
> disk.


No, that's not the issue. The issue is what I explained in my response to
Dave.


 
Reply With Quote
 
AJR
Guest
Posts: n/a
 
      5th Oct 2009
Regarding "...bak files (using del *.bak) produced every time I compact the
OE folders...." - compacting OE folders does not result in *.bak files.





"Bill in Co." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can someone tell me how to do this? I want to simply run it to delete
> the .bak files (using del *.bak) produced every time I compact the OE
> folders, instead of having to do this manually each time (by selecting
> them each time in the recycle bin, which is a hassle).
>
> I know how to write the batch file, but the Recycle folder is a system
> folder, and is apparently locked down so I can't ever get it to work.
> And trying to remove the system attribute on the Recycler/Recyled folder
> doesn't seem to work either (nor is it probably a good idea).
>



 
Reply With Quote
 
Paul Randall
Guest
Posts: n/a
 
      5th Oct 2009


"Bill in Co." <(E-Mail Removed)> wrote in message
news:ul%(E-Mail Removed)...
> Pegasus [MVP] wrote:
>> "Bill in Co." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Can someone tell me how to do this? I want to simply run it to delete
>>> the .bak files (using del *.bak) produced every time I compact the OE
>>> folders, instead of having to do this manually each time (by selecting
>>> them each time in the recycle bin, which is a hassle).
>>>
>>> I know how to write the batch file, but the Recycle folder is a system
>>> folder, and is apparently locked down so I can't ever get it to work.
>>> And trying to remove the system attribute on the Recycler/Recyled folder
>>> doesn't seem to work either (nor is it probably a good idea).

>>
>> Deleting a file from the Recycled folder by means of a batch file is
>> easy,
>> provided that you have appropriate privileges.

>
> I do - I'm the Administator and sole user of my computer.
>
>> However, there are two issues
>> that are more serious:
>> - Interfering with this folder is likely to corrupt the Recycle Bin.

>
> Not if I do it right. :-)
>
>> - Deleted files are not stored under their original names but under some
>> artificial name.

>
> I can identify the file names, but my access to the folder in a batch file
> to do such operations isn't working, that's all. You know, you get the
> standard "not resetting the system attribute.." message, or whatever, when
> you attempt it in the batch file.
>
>> The link between the two names appears to be stored in a
>> filed called INFO2 which is also kept in the this folder. Extracting the
>> original name from INFO2 does not seem to be straightforward.

>
> But again, I think I have access to the filenames ok.
>
>> In view of the above I suggest you drop the idea. If the OE backup files
>> cause your disk to get full to capacity then it's time to buy a larger
>> disk.

>
> No, that's not the issue. The issue is what I explained in my response to
> Dave.


Hi, Dave
If you have some VBScripting skills and can groups.google the
microsoft.public.scripting.vbscript newsgroup, you should be able to find
some sample scripts and snippits that use the shell object to get into
special folders and locate and delete the files of interest.
This thread might contain most of the info you need.
http://groups.google.com/g/78d7fef5/...a48cb73ef9c816

-Paul Randall


 
Reply With Quote
 
Bill in Co.
Guest
Posts: n/a
 
      5th Oct 2009
AJR wrote:
> Regarding "...bak files (using del *.bak) produced every time I compact
> the OE folders...." - compacting OE folders does not result in *.bak
> files.


You'd better check again. It most certainly does (assuming you have SP2 or
SP3 installed). They are in your Recycle Bin (assuming you have compacted
them). (They aren't *.bak, they are the foldernames.bak. The *.bak is
for the .bat file)

>
>
> "Bill in Co." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Can someone tell me how to do this? I want to simply run it to delete
>> the .bak files (using del *.bak) produced every time I compact the OE
>> folders, instead of having to do this manually each time (by selecting
>> them each time in the recycle bin, which is a hassle).
>>
>> I know how to write the batch file, but the Recycle folder is a system
>> folder, and is apparently locked down so I can't ever get it to work.
>> And trying to remove the system attribute on the Recycler/Recyled folder
>> doesn't seem to work either (nor is it probably a good idea).



 
Reply With Quote
 
Bill in Co.
Guest
Posts: n/a
 
      5th Oct 2009
Paul Randall wrote:
> "Bill in Co." <(E-Mail Removed)> wrote in message
> news:ul%(E-Mail Removed)...
>> Pegasus [MVP] wrote:
>>> "Bill in Co." <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Can someone tell me how to do this? I want to simply run it to delete
>>>> the .bak files (using del *.bak) produced every time I compact the OE
>>>> folders, instead of having to do this manually each time (by selecting
>>>> them each time in the recycle bin, which is a hassle).
>>>>
>>>> I know how to write the batch file, but the Recycle folder is a system
>>>> folder, and is apparently locked down so I can't ever get it to work.
>>>> And trying to remove the system attribute on the Recycler/Recyled
>>>> folder doesn't seem to work either (nor is it probably a good idea).
>>>
>>> Deleting a file from the Recycled folder by means of a batch file is
>>> easy, provided that you have appropriate privileges.

>>
>> I do - I'm the Administator and sole user of my computer.
>>
>>> However, there are two issues
>>> that are more serious:
>>> - Interfering with this folder is likely to corrupt the Recycle Bin.

>>
>> Not if I do it right. :-)
>>
>>> - Deleted files are not stored under their original names but under some
>>> artificial name.

>>
>> I can identify the file names, but my access to the folder in a batch
>> file
>> to do such operations isn't working, that's all. You know, you get the
>> standard "not resetting the system attribute.." message, or whatever,
>> when you attempt it in the batch file.
>>
>>> The link between the two names appears to be stored in a
>>> filed called INFO2 which is also kept in the this folder. Extracting the
>>> original name from INFO2 does not seem to be straightforward.

>>
>> But again, I think I have access to the filenames ok.
>>
>>> In view of the above I suggest you drop the idea. If the OE backup files
>>> cause your disk to get full to capacity then it's time to buy a larger
>>> disk.

>>
>> No, that's not the issue. The issue is what I explained in my response
>> to
>> Dave. (I have several files in there I want to keep; this is selective)

>
> Hi, Dave
> If you have some VBScripting skills and can groups.google the
> microsoft.public.scripting.vbscript newsgroup, you should be able to find
> some sample scripts and snippits that use the shell object to get into
> special folders and locate and delete the files of interest.
> This thread might contain most of the info you need.
> http://groups.google.com/g/


78d7fef5/t/33e20952f1cd6185/d/35a48cb73ef9c816
>
> -Paul Randall


I'm not sure, but I think you're directing this to me as the OP, and not
Dave.

I know how to delete files in a .bat file, but the problem is being able to
do it with the Recyled folder, which seems to be totally guarded against any
such "encroachments". Are you saying there is no way to do it without
resorting to writing some sort of a VBS script?


 
Reply With Quote
 
Anthony Buckland
Guest
Posts: n/a
 
      5th Oct 2009
Why go for complicated solutions, when all you have to do
is to open the Recycle Bin, Arrange Icons by Type, click
on the first .bak file, scroll down, Ctrl-Shift click on the last
..bak file, and Delete them?


 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a
 
      5th Oct 2009
*** See below.

"Bill in Co." <(E-Mail Removed)> wrote in message
news:ul%(E-Mail Removed)...
> Pegasus [MVP] wrote:
>> "Bill in Co." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Can someone tell me how to do this? I want to simply run it to delete
>>> the .bak files (using del *.bak) produced every time I compact the OE
>>> folders, instead of having to do this manually each time (by selecting
>>> them each time in the recycle bin, which is a hassle).
>>>
>>> I know how to write the batch file, but the Recycle folder is a system
>>> folder, and is apparently locked down so I can't ever get it to work.
>>> And trying to remove the system attribute on the Recycler/Recyled folder
>>> doesn't seem to work either (nor is it probably a good idea).

>>
>> Deleting a file from the Recycled folder by means of a batch file is
>> easy,
>> provided that you have appropriate privileges.

>
> I do - I'm the Administator and sole user of my computer.


*** So am I, and I can delete any file in the Recycled folder.

>> However, there are two issues
>> that are more serious:
>> - Interfering with this folder is likely to corrupt the Recycle Bin.

>
> Not if I do it right. :-)


*** Please elaborate.

>> - Deleted files are not stored under their original names but under some
>> artificial name.

>
> I can identify the file names, but my access to the folder in a batch file
> to do such operations isn't working, that's all. You know, you get the
> standard "not resetting the system attribute.." message, or whatever, when
> you attempt it in the batch file.


*** How can you identify the file?

>> The link between the two names appears to be stored in a
>> filed called INFO2 which is also kept in the this folder. Extracting the
>> original name from INFO2 does not seem to be straightforward.

>
> But again, I think I have access to the filenames ok.
>
>> In view of the above I suggest you drop the idea. If the OE backup files
>> cause your disk to get full to capacity then it's time to buy a larger
>> disk.

>
> No, that's not the issue. The issue is what I explained in my response to
> Dave.


If you can answer the above questions then we can probably find a suitable
method. Note that using a VB Script solution is *not* a magic bullet for
permission issues.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file to delete underscore files. New Orleans Novice Windows XP New Users 12 17th Mar 2009 08:44 PM
Batch file to delete files/folders? Brian Wescombe Windows XP Help 1 1st Oct 2006 11:59 PM
Batch file to delete files by date (Or VBScript?) Ragnar Microsoft Windows 2000 CMD Promt 4 7th Feb 2006 03:49 PM
batch file to delete files based on criteria djc Microsoft Windows 2000 CMD Promt 6 7th Jun 2004 04:20 PM
Batch file to empty recycle bin MrsSoto Windows XP General 1 2nd Feb 2004 06:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.