Solved

Quick way of finding DLL in System32 directory?

Posted on 2014-11-05
2
88 Views
Last Modified: 2014-11-13
What is the best way to programatically find a file, in this case a DLL, in the C:\Windows\System32 directory?
0
Comment
Question by:BlakeMcKenna
2 Comments
 
LVL 32

Accepted Solution

by:
it_saige earned 500 total points
ID: 40425339
Disregarding security considerations, you can use either the File or FileInfo classes.
Module Module1
	Sub Main()
		Console.WriteLine(If(System.IO.File.Exists("C:\Windows\System32\kernel32.dll"), "Sytem.IO.File reports that C:\Windows\System32\kernel32.dll; exists.", "Sytem.IO.File reports that C:\Windows\System32\kernel32.dll; does not exist."))
		Console.WriteLine(If(New System.IO.FileInfo("C:\Windows\System32\kernel32.dll").Exists, "Sytem.IO.FileInfo reports that C:\Windows\System32\kernel32.dll; exists.", "Sytem.IO.FileInfo reports that C:\Windows\System32\kernel32.dll; does not exist."))
		Console.ReadLine()
	End Sub
End Module

Open in new window


Produces the following output:Capture.JPG
System.IO.File - VB Code Snippets
System.IO.FileInfo - VB Code Snippets

-saige-
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 40440550
Thanks it_saige...that's what I was looking for!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
reports, calling from code. 3 30
Paging GridView 7 34
Set form below another form 3 25
Red error squiggly on vb.net 7 10
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now