473,509 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search for a file on all drives of a computer

Hi there,

I would need your help again.

I am using Dev Avish's API function "Search for a file"
http://www.mvps.org/access/api/api0006.htm
to find a file on my computer which works well. As you may know, in this
function the user needs to specify the drive which is then searched for
the specific file.

What I would like to do, however, is to search all drives incl.
removable devices of the computer for a file. I have tried to use "My
Computer" as strDrive, but this does not really work.

Can anyone point me into the right direction ... ?

Many thanks!

Best regards,

Sabine

*** Sent via Developersdex http://www.developersdex.com ***
Sep 6 '07 #1
3 5505
On Sep 6, 10:59 am, Sabine <sabine.xxxoebbe...@xxxunilever.comwrote:
Hi there,

I would need your help again.

I am using Dev Avish's API function "Search for a file"http://www.mvps.org/access/api/api0006.htm
to find a file on my computer which works well. As you may know, in this
function the user needs to specify the drive which is then searched for
the specific file.

What I would like to do, however, is to search all drives incl.
removable devices of the computer for a file. I have tried to use "My
Computer" as strDrive, but this does not really work.

Can anyone point me into the right direction ... ?

Many thanks!

Best regards,

Sabine

*** Sent via Developersdexhttp://www.developersdex.com***
Since 'all drives' can be a dynamic thing (floppy, removable,
external, network, etc) you can open a huge can of worms searching
'all drives'. You could test for eash drive letter A: - Z: and if it
exists search for the file(s) in question. Even without any overhead
issues, searching 'all drives' could be an extremely time consuming
process...
Sep 6 '07 #2
Sabine wrote:
Hi there,

I would need your help again.

I am using Dev Avish's API function "Search for a file"
http://www.mvps.org/access/api/api0006.htm
to find a file on my computer which works well. As you may know, in this
function the user needs to specify the drive which is then searched for
the specific file.

What I would like to do, however, is to search all drives incl.
removable devices of the computer for a file. I have tried to use "My
Computer" as strDrive, but this does not really work.

Can anyone point me into the right direction ... ?

Many thanks!

Best regards,

Sabine

*** Sent via Developersdex http://www.developersdex.com ***
This will loop thru drives A-Z.

Sub ScanAndSearchAllDirs()
Dim intDir As Integer
Dim strDir As String
Dim lngErr As Long
For intDir = 65 To 90
On Error GoTo 0
On Error Resume Next
strDir = DIr(Chr(intDir) & ":\*.*")
If Err.number = 0 Then
'search routine here
'MsgBox Chr(intDir) & " " & strDir
End If
Next intDir
MsgBox "Done"

End Sub
Sep 6 '07 #3
This is p e r f e c t .

It works :).

Many thanks!

Sabine

*** Sent via Developersdex http://www.developersdex.com ***
Sep 7 '07 #4

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

Similar topics

3
1680
by: J Poirier | last post by:
Hi All, I'm hoping that someone might have some pointers or examples on how to proceed with a solution to the following problem: A test application, which produces a trace file, is being run...
0
5771
by: mm | last post by:
Can someone with Win 2K please help me here. Best yet, can some MVP duplicate it and report it to MS. I can't find any reference to this issue on the Web, or in MS Knowledge Base. I have been...
2
12128
by: lastusernameleft | last post by:
Is there a .NET method for doing this? I haven't found anything else that works. Thanks
6
1862
by: E Pease | last post by:
I have been trying to edit the Explorer example by Dev Ashish I found on www.msvp.org (I think). I have been all over the net so I am not quite sure where the file came from. I like the way it...
11
3046
by: Andre | last post by:
Hi, I have ASP.NET application running on standalone (not part of the domain) Windows 2003. I use forms authentication for my application. The problem I have is that I need to create and read...
12
5544
by: benjamin.krulewitch | last post by:
I'm debugging an issue with a C program that causes the computer to crash, and I'm attempting to log information immediately before the crash occurs. I us my BKprintLog function (see below) to...
3
4804
by: James Maeding | last post by:
I am familiar with using My.Computer.FileSystem.GetDirectoryInfo to get folder attributes, see code below... This does not work though for network drives on my companies system. We use windows as...
3
3689
by: rohit | last post by:
hi i want to detect all file change operations(rename,delete,create....) on ALL THE DRIVES of the hard disk using the method ReadDirectoryChanges API , i.e program no. 3 in the webpage...
4
2501
by: ravindarjobs | last post by:
hi...... i am using ms access 2003,vb6 i have a form. in that i have 2 buttons 1. start search 2 stop search when i click the "start search" button the fucntion SearchSystem() is called,...
0
7237
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
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
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
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
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...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.