473,386 Members | 1,860 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,386 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 7176
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.