how to set directory to "MyComputer"

  • Thread starter Thread starter barbara_dave
  • Start date Start date
B

barbara_dave

Hi, all,


I like to know to how to set fileopendialog inital directory to
"MyComputer".

Thanks
 
I like to know to how to set fileopendialog inital directory to
"MyComputer".

Use the CLSID prefixed by two colons:

Const STR_MYCOMPUTER_CLSID As String = _
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}" ' My Computer

OpenFileDialog1.InitialDirectory = "::" & STR_MYCOMPUTER_CLSID
OpenFileDialog1.ShowDialog

Thorsten Doerfler
 
Hi Thorsten,

I tried the code below, it seems setting initial directory to "A\:"
instead of "MyComputer". Maybe the const string value is wrong.

Thanks

Barbara
 
I tried the code below, it seems setting initial directory to "A\:"
instead of "MyComputer". Maybe the const string value is wrong.

Thorsten's code works perfectly on my German Windows XP Professional SP2
machine running .NET 1.1 SP1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top