By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,690 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,690 IT Pros & Developers. It's quick & easy.

how to set directory to "MyComputer"

P: n/a
Hi, all,
I like to know to how to set fileopendialog inital directory to
"MyComputer".

Thanks

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ba**********@yahoo.com schrieb:
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
--
http://www.vb-hellfire.de/
Nov 21 '05 #2

P: n/a
As far as I am aware you cannot

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #3

P: n/a
<ba**********@yahoo.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.