从上下文菜单中启用按需扫描任务的启动

2022年6月10日

ID 194306

您可以从 Microsoft Windows 资源管理器的上下文菜单中启用针对一个或多个文件的按需扫描任务的启动。

要从上下文菜单启用按需扫描任务的启动:

  1. 创建以下 REG 文件:

    Windows 注册表编辑器版本 5.0.0

    [HKEY_CLASSES_ROOT\Directory\shell\ksws\command]

    @="C:\\Temp\\scan.cmd \"%1\""

    [HKEY_CLASSES_ROOT\*\shell\ksws\command]

    @="C:\\Temp\\scan.cmd \"%1\""

    [HKEY_CLASSES_ROOT\Directory\shell\ksws]

    @="Scan with Kaspersky Security for Windows Server\"

    "Icon"="\"C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavtrayr.dll\",0"

    [HKEY_CLASSES_ROOT\Directory\shell\ksws\DefaultIcon]

    @="\"C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavtrayr.dll\",0"

    [HKEY_CLASSES_ROOT\*\shell\ksws]

    @="Scan with Kaspersky Security for Windows Server\"

    "Icon"="\"C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavtrayr.dll\",0"

    [HKEY_CLASSES_ROOT\*\shell\ksws\DefaultIcon]
    @="\"C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavtrayr.dll\",0"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]

    "C:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavshell.exe"="~ RUNASADMIN"

    您需要指定 Kaspersky Security for Windows Server 安装文件夹的实际位置。

  2. 创建具有以下内容的 scan.cmd 文件:

    @echo off
    set LOGNAME=%RANDOM%

    "C:\Program Files (x86)\Kaspersky Lab\Kaspersky Security for Windows Server\kavshell.exe" scan "%~1" /W:c:\temp\%LOGNAME%.txt

    echo Scanning is in progress...
    type c:\temp\%LOGNAME%.txt
    del c:\temp\%LOGNAME%.txt

    timeout /t -1

    scan.cmd 文件必须包含以下信息:

    • kavshell.exe 文件的位置。
    • 包含扫描结果的临时文件的位置。
    • KAVSHELL SCAN 命令的参数。
    • 用于在任务完成后关闭控制台窗口的超时值。
  3. scan.cmd 文件复制到 [HKEY_CLASSES_ROOT\Directory\shell\ksws\command] REG 文件中指定的文件夹。

    示例中使用了 C:\Temp 文件夹。

您无需重新启动操作系统。

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.