Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Windows Exporer to a specifc folder

Status
Not open for further replies.

ckennerdale

Programmer
Dec 23, 2000
158
GB
Hi
I have a button which I have used to open explorer.exe. I want this to open to a specifed folder on a netwrok drive

by default it opens into 'My Documents'

How can I specify the folder (sorry I know is probably a really basic question)

My Code-

Private Sub View_Folder_Button_Click()
On Error GoTo Err_View_Folder_Button_Click

Dim stAppName As String

stAppName = "C:\WINNT\explorer.exe"
Call Shell(stAppName, 1)

Exit_View_Folder_Button_Click:
Exit Sub

Err_View_Folder_Button_Click:
MsgBox Err.Description
Resume Exit_View_Folder_Button_Click

End Sub

Caspar Kennerdale
 
Do some googling or check the ms knowledge base. I'm positive there's stuff out there on command line switches that will show you this stuff. Or find a windows programming forum (if you don't get a solid answer here).

Also, try just putting the path into your variable, instead of the call to explorer. It works in the run box, so it might just work there.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Did it work?

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
there is no need to start Explorer.exe....."luckly" this time the whole IE and Win Explorer "love relationshiop" work in your advanatage


consider using a script to access files and start apps
OpenURL[\\server\sharename\sub_foolder\]
or
OpenURL[C:\Program Files\Program\File.exe]
IF u need to "map a drive on a fly" then u need to run the Command or CMD from windows and use "net use" command from the shell....anyhow
All the best!

> need more info?
:: don't click HERE ::
 
ooops wrong DataBase wrong forum....sorry :(
this tecnique applies to FileMaker forum.
what can I say...long day :)

> need more info?
:: don't click HERE ::
 
Jeremy
This worked

stAppName = "C:\WINNT\explorer /n,C:\Selected Folder"

Caspar Kennerdale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top