?
Solved

What is the path of MyComputer and RecycleBin?

Posted on 2008-10-29
6
Medium Priority
?
1,523 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 200 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 1800 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 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