473,666 Members | 2,571 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 5520
On Sep 6, 10:59 am, Sabine <sabine.xxxoebb e...@xxxunileve r.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 Developersdexht tp://www.developersd ex.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 ScanAndSearchAl lDirs()
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
1684
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 for very long periods of time. Say 72 hours or more.
0
5786
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 able to duplicate this problem on two different Win 2K installations. Steps: 1. Win 2K installation, SP4 with .NET 1.1 installed
2
12150
by: lastusernameleft | last post by:
Is there a .NET method for doing this? I haven't found anything else that works. Thanks
6
1866
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 works but I can not find a way to tell it to display a certain directory. I want it to display a folder on our share drive. I know the path for the directory. I want users to be able to open any files below the parent directory I tell it to start in....
11
3061
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 files on Windows domain network shared drives and also on shared via Samba Unix drives, which is equivalent to writing/reading to the workgroup computer. Please point, if possible, to detailed step by step description of what needs to be done. Thank...
12
5581
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 write information into a log file. The problem is, i'm not confident that information i write to the log gets saved onto the hard drive before the crash occurs. My understanding of hard drives and OS are that because hard drives are so slow,...
3
4817
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 our server, nothing exotic. I looked at the security permissions and the "write" box for domain users was grey, but not checked. This means read-only to me and sure enough, I cannot change the files. Is there a different way to deal with...
3
3691
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 http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html .. Please suggest some modification to the program so that i can detect changes to ALL the drives (to detect changes on c:\ set path_to_watch = "." to "c:\\" ...
4
2507
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, it will search for a particular file in the computer(searches entire drives).
0
8883
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8787
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8561
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6203
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5672
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2776
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 we have to send another system
2
2013
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.