Skip to content

Instantly share code, notes, and snippets.

@neetsdkasu
Last active September 4, 2017 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neetsdkasu/9258425 to your computer and use it in GitHub Desktop.
Save neetsdkasu/9258425 to your computer and use it in GitHub Desktop.
MSEでコマンドラインからファイルをウィルススキャンする。(simply batch to scan file by MSE(Microsoft Security Essential) on command prompt.)
@rem scanfile.bat
@rem MSEでコマンドラインからファイルをスキャンする
@rem 環境変数PATHの通った適当なディレクトリにこのファイルを設置して使う
@if "%~1"=="" goto usagelabel
@if /I "%~1"=="-p" goto pauselabel
@if /I "%~1"=="/p" goto pauselabel
@if not exist "%~1" goto usagelabel
"C:\Program Files\Microsoft Security Client\MpCmdRun.exe" -Scan -ScanType 3 -File "%~f1"
@exit /b
:pauselabel
@call "%~f0" "%~2"
@pause
@exit /b
:usagelabel
@echo scanfile.bat
@echo 説明:
@echo MSEでファイル(またはディレクトリ)をスキャンする
@echo usage: scanfile ^<path^>
@echo usage: scanfile -p ^<path^>
@echo -p スキャン後 pause を実行する
@doutanuki
Copy link

直ぐに終了されても困る。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment