7 Replies - 45387 Views - Last Post: 12 January 2010 - 04:03 PM Rate Topic: -----

#1 the_hangman  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 602
  • Joined: 18-January 06

How to open 'My Computer' folder

Posted 16 August 2006 - 06:59 AM

The title says it all... If I want to use My Computer for something in my VB.NET Application. How do I access it? Is there a path or something?

For instance I want it to display in a Web Browser. To open the C:\ drive I just make the URI = "C:\". But that doesn't work with "My Computer"
Is This A Good Question/Topic? 0
  • +

Replies To: How to open 'My Computer' folder

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to open 'My Computer' folder

Posted 16 August 2006 - 01:01 PM

My Computer is a virtual directory so it has no physical path.

Quote from MSDN:

Quote

A folder will not physically exist if the operating system did not create it, the existing folder was deleted, or the folder is a virtual directory, such as My Computer, which does not correspond to a physical path.

http://msdn2.microso...folderpath.aspx

There doesn't seem to be any evironmental variables that are associated with My Computer either, like %windir% or something along those lines.


I played with it and tried the following among other things, but it doesn't work since there is no physical path.
Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.MyComputer))


Was This Post Helpful? 0
  • +
  • -

#3 the_hangman  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 602
  • Joined: 18-January 06

Re: How to open 'My Computer' folder

Posted 16 August 2006 - 01:35 PM

Thank you sir.

Hm.. looks like I will have to 'Virtually' create it then
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to open 'My Computer' folder

Posted 16 August 2006 - 03:38 PM

There must be some way to access it, maybe through the Windows API.

Oddly enough, you cannot pass it as a parameter when opening IE. But once IE is open, you can type 'My Computer' in the address bar and it works normally.
Was This Post Helpful? 0
  • +
  • -

#5 the_hangman  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 602
  • Joined: 18-January 06

Re: How to open 'My Computer' folder

Posted 17 August 2006 - 05:54 AM

Exactly! That's what I thought was odd..
In VB I can't set the URL to "My Computer", but if I open IE and just type "My Computer" in the address bar, it comes right up. That's why I thought I could just access it..
Was This Post Helpful? 0
  • +
  • -

#6 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to open 'My Computer' folder

Posted 17 August 2006 - 12:54 PM

I did find a possible solution for you that might work.

The one drawback is that it won't open in IE even though the call is for IE. What happens is that Windows Explorer opens to the My Computer, instead of IE.

But maybe it will work for you.

Here is the link to where I found it. And it definately looks like you need to go through the Win API to do what you want.

Process.Start("iexplore.exe", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")



Looks like you just need to reference the correct registry key to access My Computer.

Hope it helps.
Was This Post Helpful? 0
  • +
  • -

#7 nojoda93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-January 10

Re: How to open 'My Computer' folder

Posted 12 January 2010 - 03:49 PM

View Postjayman9, on 17 Aug, 2006 - 11:54 AM, said:

I did find a possible solution for you that might work.

The one drawback is that it won't open in IE even though the call is for IE. What happens is that Windows Explorer opens to the My Computer, instead of IE.

But maybe it will work for you.

Here is the link to where I found it. And it definately looks like you need to go through the Win API to do what you want.

Process.Start("iexplore.exe", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")



Looks like you just need to reference the correct registry key to access My Computer.

Hope it helps.


:) Try This:
CreateObject("Wscript.Shell").Run "explorer ,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

Save it with block notes as Mycomputer.vbs
You're welcome.
Was This Post Helpful? 0
  • +
  • -

#8 nojoda93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-January 10

Re: How to open 'My Computer' folder

Posted 12 January 2010 - 04:03 PM

View Postthe_hangman, on 16 Aug, 2006 - 05:59 AM, said:

The title says it all... If I want to use My Computer for something in my VB.NET Application. How do I access it? Is there a path or something?

For instance I want it to display in a Web Browser. To open the C:\ drive I just make the URI = "C:\". But that doesn't work with "My Computer"


Try this:

CreateObject("Wscript.Shell").Run "explorer ,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

Yu're welcome.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1