473,698 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search for Directories/files/Folders

Thank you in advance for any and all assistance. I'm looking for a way to
programmaticall y scan all installed drives for programs that are installed.
Can someone point me to code to look for say, "keywords" on the installed
drives etc?

--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
Oct 10 '06 #1
5 1448
Here's a console app I just threw together that will run through and
list all exes that the program has access to. You should be able to
modify it to do what you need. Let me know if you need more help.

Thanks,

Seth Rowe
Module Module1

Sub Main()
ListAllExes("C:/")
Console.WriteLi ne("done")
Console.Read()
End Sub

Private Sub ListAllExes(ByV al path As String)
Try
' Change the "*.exe" to your search condition
Dim filenames() As String =
System.IO.Direc tory.GetFiles(p ath, "*.exe")
For i As Int16 = 0 To filenames.Lengt h - 1
Console.WriteLi ne(filenames(i) )
Next
Dim directories() As String =
System.IO.Direc tory.GetDirecto ries(path)
For i As Int16 = 0 To directories.Len gth - 1
ListAllExes(dir ectories(i))
Next
Catch ex As Exception
' do nothing
End Try
End Sub

End Module
eSolTec wrote:
Thank you in advance for any and all assistance. I'm looking for a way to
programmaticall y scan all installed drives for programs that are installed.
Can someone point me to code to look for say, "keywords" on the installed
drives etc?

--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
Oct 10 '06 #2
Seth,

Thank you for the demo console app. I'm looking to find particular programs
installed. Do you think I can modify this to find say all "symantec" programs
or "mcafee" ?
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"rowe_newsgroup s" wrote:
Here's a console app I just threw together that will run through and
list all exes that the program has access to. You should be able to
modify it to do what you need. Let me know if you need more help.

Thanks,

Seth Rowe
Module Module1

Sub Main()
ListAllExes("C:/")
Console.WriteLi ne("done")
Console.Read()
End Sub

Private Sub ListAllExes(ByV al path As String)
Try
' Change the "*.exe" to your search condition
Dim filenames() As String =
System.IO.Direc tory.GetFiles(p ath, "*.exe")
For i As Int16 = 0 To filenames.Lengt h - 1
Console.WriteLi ne(filenames(i) )
Next
Dim directories() As String =
System.IO.Direc tory.GetDirecto ries(path)
For i As Int16 = 0 To directories.Len gth - 1
ListAllExes(dir ectories(i))
Next
Catch ex As Exception
' do nothing
End Try
End Sub

End Module
eSolTec wrote:
Thank you in advance for any and all assistance. I'm looking for a way to
programmaticall y scan all installed drives for programs that are installed.
Can someone point me to code to look for say, "keywords" on the installed
drives etc?

--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.

Oct 10 '06 #3
If they use a certain naming convention you could just search for that.

Thanks,

Seth Rowe
eSolTec, Inc. 501(c)(3) <esol...@noemai l.nospamwrote:
Seth,

Thank you for the demo console app. I'm looking to find particular programs
installed. Do you think I can modify this to find say all "symantec" programs
or "mcafee" ?
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
"rowe_newsgroup s" wrote:
Here's a console app I just threw together that will run through and
list all exes that the program has access to. You should be able to
modify it to do what you need. Let me know if you need more help.

Thanks,

Seth Rowe
Module Module1

Sub Main()
ListAllExes("C:/")
Console.WriteLi ne("done")
Console.Read()
End Sub

Private Sub ListAllExes(ByV al path As String)
Try
' Change the "*.exe" to your search condition
Dim filenames() As String =
System.IO.Direc tory.GetFiles(p ath, "*.exe")
For i As Int16 = 0 To filenames.Lengt h - 1
Console.WriteLi ne(filenames(i) )
Next
Dim directories() As String =
System.IO.Direc tory.GetDirecto ries(path)
For i As Int16 = 0 To directories.Len gth - 1
ListAllExes(dir ectories(i))
Next
Catch ex As Exception
' do nothing
End Try
End Sub

End Module
eSolTec wrote:
Thank you in advance for any and all assistance. I'm looking for a way to
programmaticall y scan all installed drives for programs that are installed.
Can someone point me to code to look for say, "keywords" on the installed
drives etc?
>
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.
Oct 11 '06 #4
Hello Michael,

As Rowe has mentioned, you can use the System.IO's class to query and
search certain drives and directories on the machine. However, it is
important that you know tha keywords or naming convention of the programs
you want to search.

BTW, based on my experience, most program will add some configuration and
installation information in the system registry(under
HKEY_LOCAL_MACH INE\SOFTWARE key). For example, the Adobe reader will add
information like InstallPath, version in its registry key:

HKEY_LOCAL_MACH INE\SOFTWARE\Ad obe\Acrobat Reader

Mozilla firefox will add its exeutable's name and path through the
following keys:

PathToExe
Program Folder Path

Therefore, you can also consider performing search in windows system
registry for the certain program's installation information and then
perform further search upon file system. How do you think? Here are some
reference about registry accessing in .net:

http://www.codeguru.com/csharp/cshar...ticle.php/c103
09/

http://www.csharphelp.com/archives2/archive430.html
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

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

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 11 '06 #5
Dear Mr. Bragg,
Seth,

Thank you for the demo console app. I'm looking to find particular programs
installed. Do you think I can modify this to find say all "symantec" programs
or "mcafee" ?
If you are looking for such (installed) programs, then perhaps it is
easier to check the registry. Maybe you find the path there
(HKLM\SOFTWARE\ ...). Getting the result from there should be much
quicker than scanning the hard drive. Of course, this won't help if you
need a list of ALL programs (no matter if installed or copied).

Best Regards,

HKSHK
Oct 11 '06 #6

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

Similar topics

4
3644
by: could ildg | last post by:
I want to compare 2 directories, and find If all of theire sub-folders and files and sub-files are identical.. If not the same, I want know which files or folders are not the same. I know filecmp moudle has cmpfiles function and a class named dircmp, they may help, but I wonder if there is a ready-to-use function in python libs? If not, would somebody like to give me some propositions? Thank you.
1
8723
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast, returned the hyperlinked page title, filename, and the body txt (30 preceding and following words) in context with the search word highlighted. Excellent.! See it working at: http://www.ipt.co.za Just search for "firearm"
6
4830
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and the other named Public. I placed my web.config file in my
0
982
by: John Salerno | last post by:
Is there a way for me to somehow specify that I want Python to search all subdirectories of a particular directory when I'm running or testing files from the command prompt? For example, I have a folder in my C:\Python24 folder called myscripts\. At first I saved my scripts in there, since there weren't many, and any work I did from the command prompt I did from this directory (with the directory added to my PYTHONPATH variable). But...
10
2921
by: Dan | last post by:
Hi - I'm about a week into learning VB.NET, and I'm finding I can't delete any of the VB.NET directory structures that contain my test projects I've been trying to create. I've never seen this before... Whenever I try, it says something like "access is denied" and "make sure the disk is not write-protected and file is not currently in use". Is there something VB.NET does that would cause this? I'm starting to build up a bunch of test...
1
1684
by: rn5a | last post by:
A ListBox lists all the folders & files existing in a directory named 'MyDir' on the server. Assume that the ListBox lists 2 directories - 'Dir1' & 'Dir2' i.e. these 2 directories reside in the 'MyDir' directory. Both 'Dir1' & 'Dir2' also house sub-directories & files. Assume that the sub-directory 'Dir1' has 3 directories & 3 files. When a user comes to a ASPX page for the first time, the ListBox lists all the directories & files...
5
2910
by: Jandre | last post by:
Hi I am a python novice and I am trying to write a python script (most of the code is borrowed) to Zip a directory containing some other directories and files. The script zips all the files fine but when it tries to zip one of the directories it fails with the following error: "IOError: Permission denied: 'c:\\aaa\\temp'" The script I am using is:
9
1712
by: Lloyd Sheen | last post by:
For all those who don't think that a recursive search of files in folders is a good thing in the Microsoft.VisualBasic.FileIO.FileSystem namespace listen to this. I am reorg my mp3 collection. I have written my own catalog program and it has xml files to cache info from tags etc. To ensure that the process goes ok I went to delete all the xml files to force a rescan of the tags. This should be simple ..... but this is Vista. So...
3
1498
by: =?Utf-8?B?Tm9ybUQ=?= | last post by:
It isn't clear this is the right place to post this, but it IS related to ..NET CONFIG files... Windows Explorer (at least on W2003Server) doesn't seem to know that .config files exist. Searching for them as .config, *.*config, *.exe.config and other combinations, even when you can see them in a directory - let alone in sub-directories of for those containing text - doesn't work. I've seen the KB article on Explorer being selective in...
0
8671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9152
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
9016
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
8887
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,...
1
6515
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
5858
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();...
1
3037
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
2321
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.