Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I wrote a function in vb.net to empty recycle bin used the rd /s/q \recycler it worked fine but get stuccked with windows 2008 Can anyone suggest a way to resolve it.

I am using this line of code "rd /s/q \recycler" in a vb.net Process it worked and emptied recycle bin for all users for the active directory but it did not worked on the system on which windows 2008 was as an operating system is there any particular reason for that?

Thanks in Advance
Posted
Updated 31-May-10 20:30pm
v2
Comments
OriginalGriff 31-May-10 11:27am    
What the heck is Windows 2008?
Edit your question, and provide code sample (in <pre>...</pre> tags to preserve the formatting) to show what you are doing. Then explain your problem: "get stuccked with windows 2008" is not exactly meaningful...
Anthony Mushrow 2-Jun-10 9:15am    
I believe Windows 2008 would be Windows Server 2008

Well, do you have any more information for why it "got stuck"?
 
Share this answer
 
First off if you get an error it is always worth checking the error stream of the process, which will contain any output to the command line regarding errors; and alternative in this case is to simply open the command line run command and look at the output.

In this case your problem is that:

CMD wrote:
The system cannot find the file specified.


In Server 2008 the recycle bin is now located at $Recycle.Bin so you want to use rd /s/q \$Recycle.Bin in that case. There is however another gaping flaw here, on my machine I have a couple of HDD's and I keep the recycle bin on my drive D:\ so while the command would run fine it wouldn't actually empty my recycle bin. You would have to run the command on drive D:\ (rather than the defauly C:\)

You might want to look into other ways of emptying the recycle bin.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900