Jump to content
Lior grinberg

Scan a file with a C# program

Recommended Posts

Hi,

I wrote a c# program and one of it tasks is to scan a file for virus and get the result.

Is that possible?

Thanks,

Lior grinberg

 

Share this post


Link to post

Hi,

Цитата

Is that possible?

Could you please describe the problem with more details?

Thank you!

Share this post


Link to post

HI Nikolay,

In my C# program I want to write a code something like this:

myProcess.StartInfo.FileName = "C:\\Program Files\\kaspersky\\kaspersky.exe";

string myprocarg = "/SCAN=testfile.doc /REPORT=C:\\Upload\\Temp\\Report.txt";

myProcess.StartInfo.Arguments = myprocarg;

myProcess.Start();

myProcess.WaitForExit();

Then I will the result from the file and see if it contains viruses:

like this: file Contains("Found infections : 0"))

Hope that is clearer.

Of course the code will modify to kaspersky program and commands.

Thanks,

Lior grinberg

Share this post


Link to post

There is no need to write a special code(except for report) because KES scans all files at access automatically.

Thank you!

Share this post


Link to post
3 hours ago, Nikolay Arinchev said:

There is no need to write a special code(except for report) because KES scans all files at access automatically.

Thank you!

HI Nikolay,

My business requirement is to give this kind of report on uploaded file to our server.

So I thought that the best way to do this is by run the scan by my c# program and get the report.

I saw that this option is there for another anti virus named AVG but I want to use yours so is it possible?

Thanks.

Lior grinberg

P.s

I can share the link to the other anti virus if needed

Share this post


Link to post

Have you had a look at this: https://support.kaspersky.com/11336

 

Just start

"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Endpoint Security 10 for Windows SP2\avp.com" SCAN Filename

and you will get the result.

Share this post


Link to post
4 hours ago, ak01 said:

Have you had a look at this: https://support.kaspersky.com/11336

 

Just start

"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Endpoint Security 10 for Windows SP2\avp.com" SCAN Filename

and you will get the result.

That is looking promising.

What is the product that I need in order to run this?

Thanks,

Lior grinberg

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We use cookies to make your experience of our websites better. By using and further navigating this website you accept this. Detailed information about the use of cookies on this website is available by clicking on more information.