Solved

Quick way of finding DLL in System32 directory?

Posted on 2014-11-05
2
92 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 33

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 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