• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Program for Virus Checking

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to write a java program, which will read or fetch file name and check for virus by using some antivirus and if the file is not infected then it must return boolean true otherwise false.
But I don't know how to write the code. If anybody give me any hind or sample code then I will be thankful to him/her.
Regards,
Sundeep.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the first step would be to find the antivirus program you want to use. Finding one that can be invoked via a command line with a filename as an argument may be harder than you think! Once you've found such a program, then invoking it would just be a matter of using Runtime.exec(). But first go find the tools, then come ask for more details.
 
Sundeep Mohanty
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Well, the first step would be to find the antivirus program you want to use. Finding one that can be invoked via a command line with a filename as an argument may be harder than you think! Once you've found such a program, then invoking it would just be a matter of using Runtime.exec(). But first go find the tools, then come ask for more details.


Thank you for ur reply.
Yes actually I want to call Mcafee. Means the exe of Mcafee anti virus.
I got that exe. now I want to pass file name to the exe...that also work. But I want to call that exe from java program.
From command line while I am executing the command from command line its working...for example :
C:\Program Files\Common Files\Network Associates\VirusScan Engine\4.0.xx\scann /ALL *.txt
but while I am using the same in my java program its not working..
i.e.
Process p = runtime.exec("cmd /c find \"System\" C:\\Program Files\\Common Files\\Network Associates\\VirusScan Engine\\4.0.xx\\scann /ALL");
so pls help me..
Thanks in advance..
Regards,
Sundeep Mohanty.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic