AntiVirusScanner 1.0.1

.NET Standard 2.0 .NET Framework 3.5
There is a newer version of this package available.
See the version list below for details.
Install-Package AntiVirusScanner -Version 1.0.1
dotnet add package AntiVirusScanner --version 1.0.1
<PackageReference Include="AntiVirusScanner" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AntiVirusScanner --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AntiVirusScanner, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install AntiVirusScanner as a Cake Addin
#addin nuget:?package=AntiVirusScanner&version=1.0.1

// Install AntiVirusScanner as a Cake Tool
#tool nuget:?package=AntiVirusScanner&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Anti Virus Scanner for .NET (and COM) NuGet Package

Project Description / 概要

This library allows you to virus-scanning a file by any .NET languages (C#, F#, VB...), PowerShell, F# Script, WSH (JScript, VBScript), and any COM IDispatch client.

このライブラリは任意の.NET言語 (C#, F#, VB), PowerShell, F# Script, 及び WSH (JScript, VBScript) 等の任意の COM IDispatch クライアントから、ファイルのウィルススキャンを可能にします。

Quick Start / クイックスタート


  1. Download and add reference of this library to your C# project from "NuGet",

form Package Manager Console,

PM> Install-Package AntiVirusScanner

or dotnet CLI.

> dotnet add package AntiVirusScanner
  1. After installed this library, you can scan a file like this C# code:
var scanner = new AntiVirus.Scanner();
var result = scanner.ScanAndClean(@"c:\some\file\path.txt");
Console.WriteLine(result); // console output is "VirusNotFound".


  1. Donwload AntiVirusScanner.dll from download page.

  2. Enter commands in PowerShell console, like this:

PS> [Reflection.Assembly]::LoadFrom("c:\some\folder\AntiVirusScanner.dll")
PS> $scanner = New-Object AntiVirus.Scanner
PS> $scanner.ScanAndClean("c:\some\file\path.txt")

F# Script

  1. Donwload AntiVirusScanner.dll from download page.
  2. Write F# Script code like this, and run it.
// sample.fsx
#I "c:\some\folder"
#r "AntiVirusScanner.dll"
let scanner = new AntiVirus.Scanner()
    |> printfn "%O" // console output is "VirusNotFound".


  1. Donwload AntiVirusScanner.dll from download page, and run Install as a COM server.bat as adminstrator.

  2. Write VBScript code like this, and run it.

rem sample.vbs
Set scanner = CreateObject("AntiVirus.Scanner")
Set result = scanner.ScanAndClean("c:\some\file\path.txt")
WScript.Echo result 
' console output is  0, means "VirusNotFound". 1 is "VirusFound" (may be cleaned), 2 is "FileNotExist".

System Requirements / システム要件

  • Windows OS (7 ~)
  • .NET Framework (3.5 Client Profile ~) - or - .NET Core (2.0 ~)
  • Any anti virus application which supported IAttachmentExecute API. / IAttachmentExecute API に対応したウィルス対策ソフトウェア

Known list / 既知のリスト

  • "Microsoft Security Essentials" on Win7Pro (x64)
  • "ESET NOD32 AntiVirus 4.0" on Win7Pro (x86)
  • "Windows Defender" on Win10Pro (x64)

Who virus-scan a file? / 誰がウィルススキャンを行うのか?

This library is a wrapper of anti virus software product (such as "Microsoft Security Essentials") which you installed on your Windows OS.
Therefore, this library does not work if you do not install any anti virus software produsts on your Windows OS.

このライブラリは、あなたの Windows OS にあなたがインストールしたウィルス対策ソフトウェア("Microsoft Security Essentials" のような)のラッパーに過ぎません。
そのため、何らかのウィルス対策ソフトウェア製品があなたの Windows OS にインストールされていない場合は、このライブラリは機能しません。

Why need this library? / なぜこのライブラリが必要なのか?

Windows OS provides the common API to calling the anti virus software which is installed (Of course, the anti virus software required support the API).
However, the API to calling the anti virus software provide only COM Interface style, not supported IDispatch.
So, calling this API is too difficult from any .NET languages and script languages.

Windows OS は、インストールされているウィルス対策ソフトウェアを呼び出すための共通の API を提供しています(もちろん、インストールされているウィルス対策ソフトウェアがこの API に対応している必要があります)。
しかしこの API は COM インターフェースとしてのみ公開されており、COM の IDispatch インターフェースにすら対応していません。
そのため、各種 .NET 言語やスクリプト言語から呼び出すのが極めて困難です。
そこで、.NET のアセンブリとして、この API のラッパーを作ることで、各種 .NET 言語やスクリプト言語からこの API を容易に利用可能にしました。


Mozilla Public License Version 2.0

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net35 net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 3.5

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 643 4/6/2022
1.0.1 23,083 12/25/2018
1.0.0 29,259 9/16/2011

- Add .NET Core support.
- 1st release.