Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Search For A File In All Drives And Retrieve The First Path In Which The File Is Foun


i need the code for searching a file from the drives and storing the path of the file in a variable. Say the file name is input.exe. i just need to search this particular file alone in my drives and retrieve the path in a variable.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Search Multiple Drives For File
hey guys. i need some method for searching for a file across multiple drives, and then running the file. so far, i have

Code:
Private intDrive As Integer
Private strDrive As String
Private strCommand As String
Private Sub Form_Load()
For intDrive = 1 To 25
If intDrive = 1 Then
strDrive = "B"
ElseIf intDrive = 2 Then
strDrive = "C"
ElseIf intDrive = 3 Then
strDrive = "D"
ElseIf intDrive = 4 Then
strDrive = "E"
ElseIf intDrive = 5 Then
strDrive = "F"
ElseIf intDrive = 6 Then
strDrive = "G"
ElseIf intDrive = 7 Then
strDrive = "H"
ElseIf intDrive = 8 Then
strDrive = "I"
ElseIf intDrive = 9 Then
strDrive = "J"
ElseIf intDrive = 10 Then
strDrive = "K"
ElseIf intDrive = 11 Then
strDrive = "L"
ElseIf intDrive = 12 Then
strDrive = "M"
ElseIf intDrive = 13 Then
strDrive = "N"
ElseIf intDrive = 14 Then
strDrive = "O"
ElseIf intDrive = 15 Then
strDrive = "P"
ElseIf intDrive = 16 Then
strDrive = "Q"
ElseIf intDrive = 17 Then
strDrive = "R"
ElseIf intDrive = 18 Then
strDrive = "S"
ElseIf intDrive = 19 Then
strDrive = "T"
ElseIf intDrive = 20 Then
strDrive = "U"
ElseIf intDrive = 21 Then
strDrive = "V"
ElseIf intDrive = 22 Then
strDrive = "W"
ElseIf intDrive = 23 Then
strDrive = "X"
ElseIf intDrive = 24 Then
strDrive = "Y"
ElseIf intDrive = 25 Then
strDrive = "Z"
End If

strCommand = strDrive & ":" & "Program.exe"
Shell (strCommand)

Next
End Sub
this sort of works except if the file isn't on the first drive, the program end with a error. any help? thanks

How Can I Search Files In Drives And Get It's Path?
I'd like to get the Path of a file in a Drive.
For Ex.
FileName = "Northwind.mdb"
I'd like to know the exact path of where Northwind.mdb is in my "C:" Hard Drive
or my "D:" Mapped Network Drive.
I need to get the exact path so that I can point to that Database and Compact
that Database.
I'm trying to make an Access .mdb that will compact another .mdb Database.
I'm able to do this but I have a problem with setting the Path of the Database
to Compact.

In Access CurDir() does not work because it always has "My Documents" as its value.

How To Retrieve File Path Without App Name
I am currently working on a project to create a VB front-end for a number of documents on a CD. The user can put the CD in, the application will autorun, and upon clicking a button they can open the correct file.

Unfortunately, while the structure of the files on the CD will never change, some machines will use D, some E, some F, etc. as their CD drive letter. In searching for a way to get the full path of the root folder, I came across this bit of code:


Code:

Private Declare Function GetModuleHandle Lib "kernel32" _
Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long

Private Declare Function GetModuleFileName Lib "kernel32" _
Alias "GetModuleFileNameA" (ByVal hModule As Long, _
ByVal lpFileName As String, ByVal nSize As Long) As Long

'Declare Constants
Const SW_SHOWNORMAL = 1
Const MAX_PATH = 206

Function GetFilePath() As String
Dim sBuffer As String
Dim handle As Integer
Dim result As Integer

sBuffer = Space$(MAX_PATH)
handle = GetModuleHandle(App.EXEName)
result = GetModuleFileName(handle, sBuffer, MAX_PATH)
result = result - 22
GetFilePath = Left$(sBuffer, result)
End Function


This returns the path of my VB application, but only if the name of the file remains exactly 22 characters long.

My question is this: Is there any way to get just the length of the name of the application, to use in place of the "-22?"

Also, I'm fairly new to VB. Certainly very new to this kind of program. If I'm going about this the wrong way, if there is a simpler or more efficient way to do what I need, please let me know.

Any help on this issue would be greatly appreciated.

- Pat

Search For A Shortcut .exe File And Displays The It's File Path
Hi there,

I m not very familiar with vb.net so i would b so grateful if anyone could help me.
This is wat i m trying to do.
I have a an shortcut exe file on the desktop. On the design form,i have 2 textboxes and one button. The first textbox allow the user to input the exe file name. When i click the button, the second textbox display the path of the file.

Can any1 help me n give me some advice on how i should approach this. I appreciated if u could give me an example of the code.

Thanks in Advance

How To Retrieve Pst File Name And Path From Storeid In Outlook
Anyone know in VB how to use the StoreID to find which PST file it is associated with? I want to be able to add a store and then do stuff with it, but I have no way to know which store I added because the AddStore procedure doesn't seem to give me any information about what I have added, such as the StoreID - just that it has been added.

Ppt Or Pps File Path To Store In And Retrieve From Access2000 In Vb6
Sir,
Is it possible to store the path of ppt or pps file so that it can be seen later in an image box or a picture box on a VB form? Or is it possible to store the ppt or pps file itself?

pkb_pkb

Search File Path
Is there anyway to make the button using vb functions as the button(with 3 dots) in the VB's project properties that return a path for the searched file..

Search File Path
Is there anyway to make a button using vb to functions as the button(with 3 dots) in the VB-Project Properties that return the path of the searched file?

Search Registry For File Path
Hi  

Is there any way to search through the registry to get the path of a certain ocx or dll?

Background: I am writing an app that will list the dependencies of exe's, dll's and oxc's recursively. My problem now is that when I get the dll name from say the exe I need to get the dependencies of that dll. (Simmilar to Visual Studios Depends app).
When using FileSystemObject - it takes forever.

My thinking now is to read the registry to get the path of the dll / ocx.

Is there an easy way to do this??

Any help will be much appreciated.

Listing Search Results Like File Path And Name Through Excel
I ran the following code in Visual Basic 6 with the reference on Microsoft Excel 9.0 Object Library checked on. I ran it several times this morning and it worked fine. I'm sure I didn't make any changes to it and now I get the following error:

I get an invalid procedure call or argument - Run-time error '5'
And the yellow highlight is on .FileType = msoFileTypeDatabase
Is there anyone can help me with this?
Thanks,
Stephen LeCompte



Code:
Private Sub Command1_Click()
'Search for files -
Dim A As Long
Dim B As Integer
Dim C As Integer
Dim I As Integer
Dim D As Integer
With Application.FileSearch
.NewSearch
.LookIn = "C:"
.SearchSubFolders = True
'.MatchTextExactly = True
.FileType = msoFileTypeDatabases

End With

A = Application.FileSearch.Execute

With Application.FileSearch
For I = 1 To .FoundFiles.Count
B = Len(Dir(.FoundFiles(I)))
C = Len(.FoundFiles(I))
D = C - B
'File Path
'MsgBox .LastModified(I)
MsgBox Left$(.FoundFiles(I), D)
'File Name
MsgBox Dir(.FoundFiles(I))
Next I
End With
End Sub

Search A Particular File In The Hard Drive And Display Its Path
How can I do this? I want to display the path of the database in the hard drive.

Search For File But Not With "App.path"
how do you make it so that when the form loads it will search for a file that's not in the same directory as the application. how do you make it search C: for the file but not c:program filesla bla blala2la.exe?

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: cgeorge@thevortex.com
for the address

How Can I Retrieve File Resolution From An Image File?
In a function, I would like to retrieve file resolution from an image file.

In Scripting.FileSystemObject there is no property for resolution

Any Idea…? How can I retrieve file resolution from an image file?

Finding A File On CD Drives
Hi all, I'm trying to make a CD to send to my family and frinds with music and pictures. I want a VB form to launch when they put the cd in that will play a Flash .swf file ON the form. My problem is that I need the program to find the .swf file on the CD no matter what drive it's in. Here is what I have so far, but I get a run-time error that says Bad File Name of Number. Please have a look and point out any errors I have made, thanks!


Code:
Option Explicit

Private Sub Form_Load()
Dim fso As New Scripting.FileSystemObject
Dim drv As Drive
Dim CDPath$()
Dim x As Integer
x = 0
For Each drv In fso.Drives
If drv.DriveType = CDRom Then
ReDim Preserve CDPath(x)
CDPath(x) = drv.Path
x = x + 1
Exit For
End If
Next drv
Set drv = Nothing
Set fso = Nothing
For x = 0 To UBound(CDPath)
If Dir(CDPath(x) & "Background.swf") <> "" Then
Call ShockwaveFlash1.LoadMovie(0, CDPath(x) & "Background.swf")
End If
Next x
End Sub
When I debug, it highlights this line:
If Dir(CDPath(x) & "Background.swf") <> "" Then

75 Path/file Access Error , When I Try To Write The File As A Standard User
Hi ,
I am using Windows-xp o.s . i was tried to run the following code in 3 different group membership
1. standard user
2. Restricted user
3. others(Administrators)
i am able to run the code in others(administrator) only but not in standard user & restricted user ie i am getting exception "75 :path/file access error". but i am able to create file as a standard user through windows ie) ( rightclick->new->new text document ) but not through this vb code.why this conflict is happening ? if anyone know the answer kindly reply it ? . thanks in advance.
=================================================
form1
=====
'Creates a file called test1.txt and writes some text into it.
Private Sub Form_Load()

Open "f:Test1.txt" For Output As #1
Write #1, "This is some sample text"
Write #1, "Programmershelp.co.uk"
Close #1

End Sub

====================================================

Path/File Access Error. Unable To Read Or Write The Specified File
Hi,


I am getting the following error

"Path/File Access Error. Unable to Read or write the specified file.

Unable to Display the Image"


Following is the Code i am using .
With ImgEdit1
.Image = gStrFilePath & "" & pImagefile
.Page = 1
.Display
.FitTo 1
End With


The OS is windows 2000 and i am using ImageEdit control

the variable gStrFilePath contains the Path of the file
PImagefile contains the Image Name . Image is Tiff image.


If i click OK on the error messages the application closes. If i run the application again i am able to display the same Image.


Pls Help me

Path/File Access Error Grrr. It There A Way To Check To See If The File Is In Use?
Cause once I get this error a can't "On Error" around it.

How To Display Jpg File In Crystal Report Using File Path From Sql Table ?
hello friends,
i want to display jpg file in crystal report using file path from sql table,

if you have any idea please guid me.

Access Err &"Couldn't Open ..File Path..File Already In Use?
I have a number of shared access db's I administer. from time to time these db's 'lock' with no .ldb locking file and displays the err "Couldn't open "x:Shared DBShared.mdb" file already in use"
This 'locks' the db to all users. could any body shed some light on why this happens or any work arounds / fixes?

How To Get The File Path Of An Image File If It Is Running In Application Like Paint
I'm developing an application which lists all the files which are running in the system at a particular moment.
I've used the APIs CreateToolhelpSnapshot, ProcessFirst, ProcessNext, to list the full file path.

But I'm unable to handle the following situations:

if I open MS-Paint or any other application, then I'm getting the path of the exe corresponding to MS-Paint. But How to get the path of the image files which are opened by the Paint application?

It will be very kind, if someone helps me out.


Padipta Basu

How To Get The File Path Of An Image File If It Is Running In Application Like Paint
I'm developing an application which lists all the files which are running in the system at a particular moment.
I've used the APIs CreateToolhelpSnapshot, ProcessFirst, ProcessNext, to list the full file path.

But I'm unable to handle the following situations:

if I open MS-Paint or any other application, then I'm getting the path of the exe corresponding to MS-Paint. But How to get the path of the image files which are opened by the Paint application?

It will be very kind, if someone helps me out.


Padipta Basu

How To Find A File On Local Drives
Hi
Can anyone tell me how to write a function in VB6.0,
to search all local drives and locates a specified file and
returns its path.
Thanks,
Tomaz

Resource File Problem - Extracting File To Path
Hello.

Could you please tell me how to extract file from the *.res file into a selected path? I already loaded all files into resource but r unable to process them from inside it so need to extract them. Coudn't find anywhere. Please help me with a line of code.

Thanks and best regards

Default Path Of File Dialog Is Taken From A Text File
I want to make the default path of my file dialog to be the text of a text file (if the path exists, of course). What I have:

General Declarations:

VB Code:
Dim fso As New FileSystemObjectDim SaveOpenPath As String


(Obviously) Form Load:

VB Code:
Private Sub Form_Load()    If fso.FileExists(App.Path & "SaveOpenPath.txt") Then        Dim numFreeFile As Integer, length As Long        numFreeFile = FreeFile        Open App.Path & "SaveOpenPath.txt" For Input As numFreeFile            length = LOF(numFreeFile)            If length < 32767 Then                SaveOpenPath = Input$(length, numFreeFile)            Else                MsgBox "The path is larger than 32Kb", , "Sorry!"            End If        Close numFreeFile    Else        SaveOpenPath = App.Path    End IfEnd Sub


In Save and Open procedures:

VB Code:
With cdb'blah blah blah nothing important.InitDir = SaveOpenPath'blah blah blah nothing importantEnd With


I guess that's all that's important for loading my default path...I have successfully written the path that I want into the text file (using the program), but if you think I might have done something wrong in there, I can post that code, too. In the text file, it just says the path, not quotes, no nothing else...just the path. So can anybody help me with this? Thanks.

Remove File Extension From A String Of A File Path
I need to take a file extension off a string:


VB Code:
cPDB = flbMain.List(nPDB)


returns:

"C:my documents est.pdb"

and I want to remove the ".pdb"

How?

Thanks for any help

- Jake

Windows File Explorer Last Selected File Path, Can It Be Used?
Is there a way to let VB know the file path that was last selected by Windows File Explorer?
I have written some routines that uses file selection but I sometimes go to explorier to do other
things while my VB program is running . I would like for my return to vb program and have it
go to the last selected Windows File Explorer path location. Can this be done??

VB 6 : Dialog Box To Select File Path But Do Not Open File
Hi,

I am hoping that you can help. I would like to have a dialog box which allows me to choose a file. However, I do not want to open the file but set the filepath as string so that I can use it as a variable later.

Thanks in advance for your help

Danielle

App.Path On Network Drives
How do you use app.path on networkdrives?
And I mean have VB figure it's relative path out himself.

I heard it didn't work unless the network drives were named as local drives (F:; G and not "\networkdrivesomething"

I also heard you could still get it to work if you did someting.

Can anybody help me figure out which of the above is true?

Also -if app.path doesn't work with networkdrives -is there a way to
use relative paths and network drives?

Verify A File Has Been Updated On Network Drives
I am using VB6 on win2000, I have critical files that need to be periodically updated. Presently I write the files to the local PC and then copy them to the network PC's. I need to verify that the files have been written to networked PC's. The network drives have been mapped to the local PC.

My code is as follows:

sourceFile = "c:MySourcemyFile" & fileName & ".rcp"
destinationFile = "M:MyDestmyFile" & fileName & ".rcp"
FileCopy sourceFile,destinationFile

This works fine most of the time but occationally a packet will drop along the way and it doesn't.

Identifying The Path Of Network Drives
I need to be able to identify from the full path of a network drive from it's local letter.
E.G I know G: is a network drive, but I need to know that which network server it actually refers to e.g
\Server1Network1
How can I find this out in code?

Get Current File Path, Get Windows And Run File
Hello

I'm not an usual VB programmer. Yet this time I must do it in VB. I don't have much knowledge but I need to do it quick.

So... here is what I want -

1. Check if a file exists in <SystemDrive>Program FilesMyProgHost.exe (here SystemDrive is the drive in which windows is set up). I'm currently doing this with filesystemobject.

if it returns TRUE then :
i) Get the pull path and name of current file (My vb executable). I mean something like this - my clien downloaded my application to "C:****FOLDER" directory and changed the file name to "shameless.exe". Now I want my project (when run) to retrieve this string - "C:****FOLDERshameless.exe" inside a variable.

ii) Run the previous file (<SystemDrive>Program FilesMyProgHost.exe) with my programs path+name(from step i) as a parameter .

I hope you will help me out.

Shafayat

Obtain File Path From File Pointer
Greetings!


Could you please tell me if I can obtain the file path from a file pointer?

Let us say I open a file using the "Open" command and the file handler will be 1. Can I now get the file name from the handler 1?

The problem is that I have one function which opens the file and then calls several other functions which work with this file. These functions are being passed the handler:


Code:
Public Sub OpenFile(strFileName As String)

Dim intFileNumber As Integer

intFileNumber = FreeFile
Open strFileName For Binary Access Read As #intFileNumber
Call ExternalFunction1(intFileNumber)
Call ExternalFunction2(intFileNumber)
Close #intFileNumber

End Sub

Public Sub ExternalFunction1(intFileHandler)

'Some code...

End Sub

Public Sub ExternalFunction2(intFileHandler)

'Some code...

End Sub

Now, is it possible to obtain the file path in ExternalFunction1 or ExternalFunction2 from the file handler passed?


Regards,
Sebastian Mares

How Would I Generate A Txt File Containing The Path/name Of Every File On My Computer
I am writing a security app for my own use and I have ran into trouble generating a list of all files on my Box. I was hoping there was some nice API out there but so far i have found nothing. I have considered using the Dir1,File1 controls with their names/indexes but I haven't been able to get it to work yet. Any help would be very appreciated.

Concatinate File Spaces In File Path In DOS
Group,
I have written a vbScript program that
shells out to DOS and trys to find a file. My program stops
after United in the path:

\infosysDocumentationProject-United StatesMySheet.xls

Or do I have to use some type of delimiter for the space between United and States.

Any help is greatly appreciated,
Dragonfly99

Find File Path Of Program Associated With A File
Ok, you know how you can use the following to open a file with its associated program:
Code:
Call ShellExecute(0&, vbNullString, "c:asdf.bmp", vbNullString, vbNullString, vbNormalFocus)


How can I return the file path of the program associated with a file? I don't mean open the file with its associated program, I mean only return that program's file path..
ex:
"c:asdf.bmp" would be "c:Program FilesAccessoriesmspaint.exe"



Edited by - Marce22 on 6/30/2004 5:43:59 AM

Set Up Exe File Couldnt Find The Db File Path
Hello Dear,

I have trouble and seeking your help.

I have finished my program which is connected with db named "E:students.mdb". I created set up file, using Add-in and Deveployment Wizards.

Then I use the set up file on other machine and install the program.
When i run it, it say -

"E:students.mdb is not a valid path"

I do not really know to sort this systematic way. I do really need your help, please help me.

Should i need to attach the mdb with set up? if it is, how? Or ?? Help!!!

Thanks For all troubles!

Get File Path From Existing OLE Linked File
Does anyone know if this is possible?

The original OLE was created using LINK not EMBED.

I have a user that has 'moved' all the files to a different directory, and want's to update the OLE container file..

ie: originally the path was C:Files, now its G:DATAFiles

I'll try by reading byte-by-byte and writing byte-by-byte if I have to, but I'd rather see if there's another way first.

Thanks,

Earl

Want To Use Vb To Search A Hex File, Copy Data, And Create Another Hex File
Here's a very short description of what I want to do.

I would like to be able to open a 224K hex file, and split that file into four seperate 56K files. The trick is that I need to search the 224K file for hex patterns to know how it will be split up. For example, I know that the first file will begin with the data 27 FE OC, and the following 56K of data needs to go into the first split up file. Once I find the starting point for each of the 56K files, I want to copy that 56K into seperate files.

I have used VB to write MS access integrated programs, but I haven't done much with file creation. I am a network tech, but my vb experience is limited to two semesters of classes, and writing three real programs. Can anyone provide some tips or a rough idea of how I should proceed?

Thanks,
Brian

How To Search All The Image File And Load All Into My File List Box?
How to do for searching the image file like "ico,bmp,jpg,cur.gif,pcx" and look though all my directory and display them all into my file list box?

Search For Missing File In Sequential File System
Hi all,
I have around 6K records in word format and what I want to do is to searchthru the folder and looking for the missing file and list them to aseparate text file.
I name my file this format


S03-0001.doc
S03-0009.doc
S03-0009.Corr.doc
S03-1001.doc

How can I have a function to look at a set of string starting at 0000 tooh 2002 only


Please help.

I want the loop to look at set of 4 numbers instead it is also lookingat


S03-1.doc
S03-2.doc
S03-3.doc ..............S03-999.doc

How can I modify the following code so it looks at only from 0000-6090(for say) instead

For Each fil In fso.GetFolder(strFolder).Files
If lngMin = 0 Then lngMin = CLng(Mid(fil.Name, 5, 4))
If CLng(Mid(fil.Name, 5, 4)) < lngMin Then lngMin =
CLng(Mid(fil.Name, 5, 4))
If CLng(Mid(fil.Name, 5, 4)) > lngMax Then lngMax =
CLng(Mid(fil.Name, 5, 4))
Next fil



Thanks

File Path Withouth Application Path
Hi all,

my program uses some sub directories to store data in it. The user can select files through a common dialog (file open) control.

What i need is the location of the file WITHOUT the application path/folder. So something like

app.path = c: estapplication1

filelocation = c: estapplication1files est1.txt

result (what i need) should be then = files est1.txt

Any ideas about this one?

Greetz,

per-i

Help With Path Of File / Shell Program Path
Currently I am using the shell command to open an application called Kodakprv.Exe. Their are going to be multiple users for my application and of course the Kodakprv.Exe is in a different directory on each PC. Is their a way to find the directory that the kodakprv.Exe is in and then use that as Path in the shell command to open Kodakprv.Exe. Any help would be greatly appreciated.

Here is the code I have now


Code:


sAppName = Trim(strImageName) & " - Imaging Preview"
intRet = Shell("C:Program FilesWindows NTAccessoriesImageVuekodakprv.exe \lightfootd-drivewebsecurescanimages" & strImageName, vbNormalNoFocus)

Search For A Text File In The Sytem And Search For The String In The Text File
i want to search for a text file called 'data.txt' in the system...and search for a string called 'hello world' in the file...the below code retrieves the first path of the file.. from this path i have to get the text file and search for the string

Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long

Public Function SearchAllDrives(pstrFile As String) As String
Dim i As Long
Dim strDrives() As String
Dim strMatch As String

For i = 1 To EnumerateDrives(strDrives)
strMatch = SearchDriveForFile(pstrFile, strDrives(i))
If Len(strMatch) <> 0 Then
SearchAllDrives = strMatch
Exit Function
End If
Next
End Function

' Populate a 1-base array with drive designations
' for all drive types. Return number of drives found.
Public Function EnumerateDrives(pstrDrives() As String) As Long
Dim i As Long
Dim strBuffer As String
Dim strDrive As String

ReDim pstrDrives(1 To 1)
strBuffer = Space$(255)
strBuffer = Left$(strBuffer, GetLogicalDriveStrings(255, ByVal strBuffer))
Do While InStr(strBuffer, "")
strDrive = Left$(strBuffer, InStr(strBuffer, "") - 1)
i = i + 1
ReDim Preserve pstrDrives(1 To i)
pstrDrives(i) = strDrive
strBuffer = Mid$(strBuffer, Len(strDrive) + 3)
Loop
If pstrDrives(1) = "" Then
Erase pstrDrives
EnumerateDrives = 0
Else
EnumerateDrives = i
End If
End Function

Public Function SearchDriveForFile(pstrFile As String, Optional ByVal pstrDrive As String = "C:") As String
Const MAX_PATH = 260
Dim strPath As String
Dim lngReturn As Long

strPath = String(MAX_PATH, 0)
pstrDrive = Left$(pstrDrive, 1) & ":"
If SearchTreeForFile(pstrDrive, pstrFile, strPath) <> 0 Then SearchDriveForFile = Left$(strPath, InStr(1, strPath, Chr$(0)) - 1)
End Function

Search For All Drives And Directories
Dec. 2, 2006

VB:

Hello. I am writing a small Password Manager. As this program is launched, I want this program to search automatically in drive C and its folders for a password file. If this password file is not found in drive C, then it should automatically search another drive (and its folders) that is available on the computer. I want the program to search all the drives and folders if the target file is not found. Once that file is found it should exit searching.

How do I write code to search one drive and its directories, then search the next drive and its directories, so on, until all the drives and folders are searched?

Thank you in advance for anyone's help.

Mydanvue

WMI Script To Search All C Drives??
Hey everyone,

I'm new to scripting and i need some help. I've got a deadline at work and i need to come up with a script that will search all C drives on my network for a folder at C:program fileselarc

I need to know which computers have this belarc folder and which ones don't....

I know this is probably very easy for programmers, but i'm trying to break into the field and i have a deadline ASAP.

any help would be greatly appreciated. thanks,

T

Search For File Based On File Contents
Hoping a guru out there has an answer to this ...

We are currently developing a program which in part contains a feature that allows the user to search a specified directory for files containing certain text. This is supposed to emulate the "Search" feature in Windows Explorer. Right now, we are using the Microsoft Office FileSearch object to accomplish this, which works fine except the FileSearch object will not search for punctuation. We discovered this when we went to perform a search for files containing a series of underscores (e.g., ______). Subsequent searches for other punctuation-like characters (dash, up-caret, etc.) produced similar results: the FileSearch object simply ignored the characters and returned results based on the filename pattern only. This is true not only in our code but also when performing searches using the "Search" feature within Office products such as Word. However, using the Windows Explorer "Search" with the same criteria produces the correct results.

We are looking for either (a) a solution to this problem that would allow us to continue using the FileSearch object or (b) an alternative approach, perhaps through the Windows API, that would produce the correct results. Any insight would be greatly appreciated!

Search All Drives For Files Of A Particular Type? (MP3)
I am writing a mass MP3 tag editor program, I want it to ba able to search All Local and networked drives (or drives specified by the user) for files ending in .mp3, then as it finds each file load the file info into an MSFlexGrid. Howe do I contiuously search for files untill all disks have been searched? I saw a few threads simmilar to this but none had the answer I needed.



Tell me, and i will forget...
show me, and I will remember...
Involve me, and I will learn...
-Karaethon

me: http://ffxi.allakhazam.com/profile.xml?45524


Edited by - Karaethon on 9/1/2004 11:48:18 AM

Extracting A File Name From A File Path
hey everyone

if i have got a file path e.g.

C:Douments and SettingsUserMy Documentspicture1.jpg

how can i get just the picture1.jpg off the end of it.


i got the file path using an open file dialog in the common dialog control

thank you i advance

frosty

Copyright © 2005-08 www.BigResource.com, All rights reserved