Solved

What is the path of MyComputer and RecycleBin?

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now