473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

select directory not file..

I'm looking for a way to select a directory from a local drive through a
form (like input type="file" except I want to get a directory name not just
a file). I've searched every way I could think of (refer to my brain comment
above) and come up with absolutly nothing.

Any ideas, help or pointers are appreciated.

With Regards,
Sushil Singh
----------------------
Stay not Stop
Jul 23 '05 #1
2 7178
rf
Sushil wrote:
I'm looking for a way to select a directory from a local drive through a
form (like input type="file" except I want to get a directory name not just a file). I've searched every way I could think of (refer to my brain comment above) and come up with absolutly nothing.

Any ideas, help or pointers are appreciated.


You can not do this.

--
Cheers
Richard.
Jul 23 '05 #2
"Sushil" <sk****@dataarmor.net> wrote in message
news:fd**************************@posting.google.c om...
I'm looking for a way to select a directory from a local drive through a
form (like input type="file" except I want to get a directory name not just a file). I've searched every way I could think of (refer to my brain comment above) and come up with absolutly nothing.

Any ideas, help or pointers are appreciated.

With Regards,
Sushil Singh
----------------------
Stay not Stop

MsgBox BrowseForFolder("File","Browse for a file","")
MsgBox BrowseForFolder("Folder","Browse for a folder","")

Function BrowseForFolder(sBFF,sPMT,sDIR)
BrowseForFolder = ""
If sBFF <> "Folder" And sBFF <> "File" Then Exit Function
'*
Dim objSHL
Set objSHL = CreateObject("Shell.Application")
Dim objB4F
'*
On Error Resume Next
If sBFF = "Folder" Then
Set objB4F = objSHL.BrowseForFolder(&H0,sPMT,&H0031,sDIR)
Else
Set objB4F = objSHL.BrowseForFolder(&H0,sPMT,&H4031,sDIR)
End If
BrowseForFolder = objB4F.ParentFolder.ParseName(objB4F.Title).Path
If Err.Number <> 0 Then BrowseForFolder = ""
'*
Set objB4F = Nothing
Set objSHL = Nothing
End Function

However, this requires a Microsoft control (MSCOMCTL.ocx, I think) that is
not installed on most PCs; you do get it with a Visual Studio installation,
though.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill | last post by:
Using ASP in a VBScript environment, how can I check the protection on a directory, or a particular file?
3
by: Sergey Poberezovskiy | last post by:
Hi, As part of my Windows application, I need to open a folder containing a file (fileName is specified in txtFile). I have no problem opening the folder: FileInfo info = new...
1
by: Jay | last post by:
I'm hoping someone can help me here. I'd like to implement a Select Directory dialog for an intranet utility I'm writing. I tried a couple approaches that didn't work out: * I tried the...
1
by: jef | last post by:
I need the allow the user to browse a folder to select a file... was wondering what might be the best way to do this. I only need to present the list of files to the user.. nothing more than...
13
by: Mark Kamoski | last post by:
Hi Everyone-- How can one to make a "select directory name" dialog? It would be great if one could use the FileOpenDialog but it does not seem to be straight-forward. Anyway, if you have...
3
by: Sergey Poberezovskiy | last post by:
Hi, As part of my Windows application, I need to open a folder containing a file (fileName is specified in txtFile). I have no problem opening the folder: Dim directoryName As String = New...
2
by: ghighi | last post by:
Hello, Il a downloading a file from a download.aspx page with that code: ----------------------------------------------------------------------------------------- string fileName =...
1
by: neeleshsingh12444 | last post by:
Hi I am new to this area i am working on a project (based on C)which need to select a text file from a directory . I am selecting the file by giving the path in the console window but my project...
1
by: vicsauer | last post by:
Hi! I'm just searching for a solution in creating some kind of a custom "Save" dialog in JavaScript. The goal: I have a string variable which shall be serialized as an XML file via file operations....
2
by: Jeff Gaines | last post by:
As part of learning php I have set up an automated directory/file listing process. On my server I have a directory called 'Notes' and under that a dozen or so dub-directories on various topics,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.