Solved

What is the path of MyComputer and RecycleBin?

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

Industry Leaders: 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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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