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
Solved

What is the path of MyComputer and RecycleBin?

Posted on 2008-10-29
6
1,505 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
  • 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 85

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

789 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