C:\Recycler

H

Harry Sampson

Hi,

I have donated a used computer to a friend, not realizing that all my files
are still residing in the "recycler" folder. My User Logon is still
present, but others users IDs have been removed. I now want to completely
clean out the old files by emptying the Recyler folder. This is a Win2K
system, and I am not sure if each user has their own directory or
subdirectory within Recycler? In any event, I want to clean off the old
files.

I searched through Google, and found a solution, I think. But I have a few
questions. I will outline the steps I believe I need to make, and ask my
questions.

Steps:

1) Get to C Prompt (understood)
2) cd recycler (understood)
3) attrib /s (Q: what does this do?)
4) cd SID folder name (ok)
5) attrib /s (Q: what does this do?)
6) set INFO2 attribute to -h (Q: how do I do that, and what does this do?)
7) rd INFO2 (Q: this 'rd' removes INFO2)?
8) repeat step 4-7 for all SID folders (Q: correct sequence)?

Thank you for your assistance.

Below is the message I am using for guidance.

Regards,
Harry

+++++++++++++++++++++++++++++++++++
From: George Hester
Subject: Re: Can't empty recycle bin

View this article only
Newsgroups: microsoft.public.win2000.active directory,
microsoft.public.win2000.general, microsoft.public.windowsxp.general
Date: 2004-02-06 06:50:47 PST

This folder is in every RecycleBin. Go to Start | Run | cmd | OK | cd\
| cd recycler | attrib /s | (choose any SID Name folder here) cd
S-1-5-21-1177238915-1993962763-854245398-500 (yours may be different) |
attrib /s. You should have a desktop.ini and a folder in here called
INFO2. If you set the attributes for this folder to -h you should be
able to get in it. You can also copy desktop.ini c:\*.* and then attrib
-h -s desktop.ini | del desktop.ini. Then try to get into INFO2 again.

You should see the folder in there of which you speak.

In any case if you rd INFO2 after the attribute changes to that folder
attrib -h INFO2 you will remove the dc4 folder. Do it for all the
folders off C:\RECYCLER\SID name. Anyway after you delete all these
sub-folders reboot. The Recycle Bin will recreate itself at boot. And
it should come up empty.

RecycleBin can be a major pain in the butt. What happens is that once
issues start occurring with it, they will continue indefinitely. You
can try to delete the Recycle Bin by deleting everything in C:\RECYCLER
(rd name) but the issues will likely return. These come up usually by
having different File Systems on the system
++++++++++++++++++++++++++++++++++++++++
 
R

Ray at

Replies inline.

Harry Sampson said:
Hi,
Hi.


I am not sure if each user has their own directory or
subdirectory within Recycler?

Yes, you are correct. Each user has his own.

1) Get to C Prompt (understood)

cmd.exe, not command.com, just in case.
2) cd recycler (understood)
(Assuming your command prompt opens at C:\>)

3) attrib /s (Q: what does this do?)

attrib will list or change file attributes (read only, system, hidden,
archive). The /S switch indicates that it should perform your requested
action in the current directory and also in all subdirectories.
4) cd SID folder name (ok)

Do you/will you know which SID is yours? You can get by looking in the
registry at:
HKLM\Software\Microsoft\Windowsnt\currentVersion\profileList

There will be one or more keys with SIDs listed. Find the one that contains
a value with your profile path, i.e.

ProfileImagePath=C:\Documents and Settings\Harry


5) attrib /s (Q: what does this do?)

See 3)
6) set INFO2 attribute to -h (Q: how do I do that, and what does this do?)

I don't know what that means. If you execute attrib with -h it'll turn off
the HIDDEN flag for the file(s)/directory(~ies).
7) rd INFO2 (Q: this 'rd' removes INFO2)?

rd = rmdir = Remove Directory
8) repeat step 4-7 for all SID folders (Q: correct sequence)?

That will delete everyone's recycle bin.



What I suggest you do is get your SID from the registry, then open a command
prompt and enter this, where {XXX-XXX} would be replaced with your SID
value.

rd /s {XXX-XXX}


I do not believe you need to remove the system attribute before RD'ing a
directory. But, should you get an error, you can remove system attributes
and hidden attributes by entering this first:

attrib -h -s {XXX-XXX}

Ray at work
 
H

Harry Sampson

Hi Ray,

Thank you very much for responding to my message!
cmd.exe, not command.com, just in case.

attrib will list or change file attributes (read only, system, hidden,
archive). The /S switch indicates that it should perform your requested
action in the current directory and also in all subdirectories.

Thank you for that information.

Do you/will you know which SID is yours? You can get by looking in the
registry at:
HKLM\Software\Microsoft\Windowsnt\currentVersion\profileList

There will be one or more keys with SIDs listed. Find the one that contains
a value with your profile path, i.e.

ProfileImagePath=C:\Documents and Settings\Harry

I don't know which is mine, but that is okay; I will clean out the entire
thing anyway. The computer was recently donated and the new user has not
used the new computer very much.

do?)

I don't know what that means. If you execute attrib with -h it'll turn off
the HIDDEN flag for the file(s)/directory(~ies).

That was copied (more or less) from George's copied message in my original
post. I am not clear myself. I think inside {XXX-XXX} there is a file
called INFO2 and that is supposed to be deleted?
rd = rmdir = Remove Directory


That will delete everyone's recycle bin.


Thank you for that information.


What I suggest you do is get your SID from the registry, then open a command
prompt and enter this, where {XXX-XXX} would be replaced with your SID
value.

rd /s {XXX-XXX}


I do not believe you need to remove the system attribute before RD'ing a
directory. But, should you get an error, you can remove system attributes
and hidden attributes by entering this first:

attrib -h -s {XXX-XXX}

Ray at work


Thank you very much Ray for all your help. I will be visiting the person
with the computer tomorrow, so I hope with your instructions, I should be
fine. I think your instructions addresses point 6 raised above.

Regards,
Harry
 
R

Ray at

I don't know which is mine, but that is okay; I will clean out the entire
thing anyway. The computer was recently donated and the new user has not
used the new computer very much.

If you want to get all fancy about it, you can open the command prompt and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Ray at work
 
H

Harry Sampson

Hi Ray,

I'm game. Can you provide some hints as to what is taking place? I see a
for loop and a do loop, no?

Regards,
Harry
 
R

Ray at

Yes, the "for" starts a loop. It loops through the results of the command,
'dir /b /a:s C:\Recycler'. The part after "do" in the parentheses is the
action that should be taken in each step in the loop.

Here are some links:

news://msnews.microsoft.com/microsoft.public.win2000.cmdprompt.admin
http://www.evergreen.edu/biophysics/technotes/program/batch.htm
http://www.jsiinc.com/SUBL/tip5700/rh5700.htm
http://www.commandline.co.uk/

For details on "for," enter this at the command prompt:

for /?

In relation to something like VB or VBScript, shell scripting is a bit
disorienting and cryptic-seeming. After a while, things start to make a
little sense, but after playing with shell scripts for a few years now, I
still cannot write anything complex at all. I feel like I was born to late
or something. ;]

Ray at work


Harry Sampson said:
Hi Ray,

I'm game. Can you provide some hints as to what is taking place? I see a
for loop and a do loop, no?

Regards,
Harry

If you want to get all fancy about it, you can open the command prompt and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Ray at work
 
H

Harry Sampson

Ray,

Thank-you for all your help.

Regards,
Harry


Ray at said:
Yes, the "for" starts a loop. It loops through the results of the command,
'dir /b /a:s C:\Recycler'. The part after "do" in the parentheses is the
action that should be taken in each step in the loop.

Here are some links:

news://msnews.microsoft.com/microsoft.public.win2000.cmdprompt.admin
http://www.evergreen.edu/biophysics/technotes/program/batch.htm
http://www.jsiinc.com/SUBL/tip5700/rh5700.htm
http://www.commandline.co.uk/

For details on "for," enter this at the command prompt:

for /?

In relation to something like VB or VBScript, shell scripting is a bit
disorienting and cryptic-seeming. After a while, things start to make a
little sense, but after playing with shell scripts for a few years now, I
still cannot write anything complex at all. I feel like I was born to late
or something. ;]

Ray at work


Harry Sampson said:
Hi Ray,

I'm game. Can you provide some hints as to what is taking place? I see a
for loop and a do loop, no?

Regards,
Harry

If you want to get all fancy about it, you can open the command prompt and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Ray at work
 
G

Gary Smith

Ray at said:
If you want to get all fancy about it, you can open the command prompt and
enter this. :]
for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Yes, but you can also do this, which is simpler:

rd /s C:\Recycler
 
R

Ray at

That would delete C:\Recycler as well. We just want to delete any
subdirectories that exist in it without deleting the Recycler parent
directory.

Ray at home

Gary Smith said:
Ray at said:
If you want to get all fancy about it, you can open the command prompt and
enter this. :]
for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Yes, but you can also do this, which is simpler:

rd /s C:\Recycler
 
D

Dave

why not just right click on the bin and select 'empty recycle bin'??

Ray at said:
That would delete C:\Recycler as well. We just want to delete any
subdirectories that exist in it without deleting the Recycler parent
directory.

Ray at home

Gary Smith said:
Ray at said:
If you want to get all fancy about it, you can open the command prompt and
enter this. :]
for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Yes, but you can also do this, which is simpler:

rd /s C:\Recycler
 
R

Ray at

That would only empty the current user's recycle bin. I think the OP wants
to delete an old user account's recycle bin contents. But, I think you're
probably right in thinking that we're over complicating something that has a
much simpler solution. :] Like, just show system files and then delete
whatever you like in \Recycler.

Ray at work

Dave said:
why not just right click on the bin and select 'empty recycle bin'??

Ray at said:
That would delete C:\Recycler as well. We just want to delete any
subdirectories that exist in it without deleting the Recycler parent
directory.

Ray at home

Gary Smith said:
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote:

If you want to get all fancy about it, you can open the command
prompt
and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Yes, but you can also do this, which is simpler:

rd /s C:\Recycler
 
H

Harry Sampson

Hi Ray,

Your earlier solution of

If you want to get all fancy about it, you can open the command prompt and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

worked very well.

Because this computer had multiple users with individual folders within
Recycler and some of those users were deleted, your solution was much better
than signing on each user's account and emptying the recycle bin. I typed
in your instructions exactly as given and it came clean.

Thank you.

Regards,
Kevin




Ray at said:
That would only empty the current user's recycle bin. I think the OP wants
to delete an old user account's recycle bin contents. But, I think you're
probably right in thinking that we're over complicating something that has a
much simpler solution. :] Like, just show system files and then delete
whatever you like in \Recycler.

Ray at work

Dave said:
why not just right click on the bin and select 'empty recycle bin'??

Ray at said:
That would delete C:\Recycler as well. We just want to delete any
subdirectories that exist in it without deleting the Recycler parent
directory.

Ray at home

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote:

If you want to get all fancy about it, you can open the command prompt
and
enter this. :]

for /f %q in ('dir /b /a:s C:\Recycler') do (rd /s C:\Recycler\%q)

Yes, but you can also do this, which is simpler:

rd /s C:\Recycler
 
G

Gary Smith

Ray at said:
That would delete C:\Recycler as well. We just want to delete any
subdirectories that exist in it without deleting the Recycler parent
directory.

Deleting C:\Recycler is harmless and gives even better cleanup than just
deleting its subdirectories. Windows will create a new one when it's
needed.
 
R

Ray at

I thought that it might, but I was too afraid to suggest it. :] Thanks
Gary.

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top