解决局域网调用服务器文件执行时出现的安全警告窗口(转)

上一篇 / 下一篇  2014-06-11 14:57:00 / 个人分类:自动化测试

批处理解决方案

    @ECHO OFF 
    REG Add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations /v ModRiskFileTypes /t REG_SZ /d .bat;.exe;.reg;.vbs /f 
    gpupdate /force 
    RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters 
    \\远程调用路径\NetAD.exe 

VBS解决方案

    On Error Resume Next 
    Wscript.sleep 1000'延时1000毫秒(1秒) 
    Dim WSH,Path 
    Set WSH=Wscript.CreateObject("Wscript.Shell") 
    path="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations\ModRiskFileTypes" 
    WSH.RegWrite path,".bat;.exe;.reg;.vbs","REG_SZ" 
    WSH.Run "cmd /c gpupdate /force",vbhide 
    WSH.Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters") 
    WSH.Run "\\192.168.0.110\NetAD.exe" 
    Quit

TAG:

 

评分:0

我来说两句

Open Toolbar