解决方案 »

  1.   

    WinPcap silent installer里面同时介绍了手工安装WinPcap的方法
      

  2.   

    谢谢提示;
    win7下的安装已经完成;
    代码如下:
    @echo offclsver | find "4.0." > NUL &&  goto win95  
    ver | find "4.10." > NUL &&  goto win98 
    ver | find "4.90." > NUL &&  goto win_me 
    ver | find "3.51." > NUL &&  goto win_Nt_3_5 
    ver | find "5.0." > NUL &&  goto win2000  
    ver | find "5.1." > NUL &&  goto win_xp  
    ver | find "5.2." > NUL &&  goto win2003  
    ver | find "6.0." > NUL &&  goto vista 
    ver | find "6.1." > NUL &&  goto win7
    @echo 当前系统版本无法识别
    goto end:win95
    :win98
    :win_me
    :win_Nt_3_5
    :win2000
    :win_xp
    :win2003@echo off
    if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (goto xp_86) ELSE goto xp_64:xp_64
    copy  64\Packet.dll %SystemRoot%\SysWOW64\ /Y
    copy  64\wpcap.dll  %SystemRoot%\SysWOW64\  /Y
    copy  64\pthreadVC.dll %SystemRoot%\SysWOW64\  /Y:xp_86
    copy  32\Packet.dll %SystemRoot%\system32\ /Y
    copy  32\wpcap.dll  %SystemRoot%\system32\  /Ycopy  npf.sys    %SystemRoot%\system32\drivers\  /Y
    copy  InstallWinpcap.inf    %SystemRoot%\system32\  /Yrundll32.exe setupapi,InstallHinfSection DefaultInstall 128 %SystemRoot%\system32\InstallWinpcap.infrew 启动服务
    net start npfgoto end:vista
    :win7@echo win7系列脚本
    @echo off
    if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (goto win_86) ELSE goto win_64:win_64
    copy  64\Packet.dll %SystemRoot%\SysWOW64\ /Y
    copy  64\wpcap.dll  %SystemRoot%\SysWOW64\  /Y
    copy  64\pthreadVC.dll %SystemRoot%\SysWOW64\  /Y:win_86
    copy  32\Packet.dll %SystemRoot%\system32\ /Y
    copy  32\wpcap.dll  %SystemRoot%\system32\  /Ycopy  npf.sys    %SystemRoot%\system32\drivers\  /Y
    copy  InstallWinpcap.inf    %SystemRoot%\system32\  /Yrew 注册npf服务
    sc create npf binPath= system32\drivers\npf.sys type= kernel start= auto error= normal tag= no DisplayName= "NetGroup Packet Filter Driver"rew 启动服务
    net start npfgoto end:end
    @echo 注册winpcap脚本执行完毕