Solved

What is the path of MyComputer and RecycleBin?

Posted on 2008-10-29
6
1,515 Views
Last Modified: 2013-12-17
Hi there;

A very noob question...I am writing a program C# that deletes the desktop content other than MyComputer and ReCycleBin and the D: drive...

I have to exclude MyComputer and ReCycleBin...I cannot find the paths of them under C:\Docs.Sett.\Desktop...or am i missing something?

Perhaps a register...I don't know...Would you help?

Best regards...
0
Comment
Question by:jazzIIIlove
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 8

Assisted Solution

by:eXpeLLeD_4RM_heLL
eXpeLLeD_4RM_heLL earned 50 total points
ID: 22835375
If you try these commands from the run menu it will open up MY Computer and Recycle BIn, however Im not sure if these commands will help you in your program.
My Computer : explorer.exe /root,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
Recycle Bin : explorer.exe /root,::{645FF040-5081-101B-9F08-00AA002F954E}
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 450 total points
ID: 22841094
The recycle bin isn't appearing in my file listing.  Also, I'm not sure what to do if the User has renamed the "My Computer" link.  I'm not sure .Net can read the data in Links using Native code...may need outside WinAPIs and/or VBScript:
        private void button1_Click(object sender, EventArgs e)
        {
            string Desktop = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            System.IO.DirectoryInfo di = new DirectoryInfo(Desktop);
            foreach (System.IO.FileInfo fi in di.GetFiles())
            {
                if (fi.Name != "My Computer.lnk")
                {
                    // do something with "fi":
                    System.Diagnostics.Debug.Print(fi.Name);
                }
            }
        }

Open in new window

0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 22843761
<<Im not sure what to do if the User has renamed the "My Computer" link.

impossible he can't do such a thing...under DC and policies he is...

I will be trying your code tomorrow...
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 23022468
Really sorry for my delay...I was away...
dle_Mind code is perfectly suitable for me...

Best regards...
0
 
LVL 12

Author Closing Comment

by:jazzIIIlove
ID: 31511376
Idle_Mind: your code is suitable for me...
eXpeLLeD_4RM_heLL: thanks for the registry...I will use it for future use...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question