如何把Moldflow所有程序加入防火墙
发布者:cadit 发布时间:2016/1/18 阅读:2637 次

•copy脚本到:

          Moldflow Insight 2016\bin或者Moldflow Synergy 2016\bin

•运行脚本vbs文件        
•Dim oFolder, oFile, WshShell,fso,oFiles
•Set fso=CreateObject("Scripting.FileSystemObject")
•Set Wshshell=wscript.CreateObject("wscript.shell")
•Dim oFWMgr
•Set oFWMgr=CreateObject("HNetCfg.FwMgr")
•oFolder=Wshshell.CurrentDirectory
•Set oFolder=fso.GetFolder(oFolder)
•Set oFiles=oFolder.Files
•'Set oTxt=fso.CreateTextFile(oFolder+"\allstudyname.txt")
•For Each oFile In oFiles
•    if StrComp(Right(oFile.Name,4),".exe")=0 Then
•      Dim oApp
•  Set oApp=CreateObject("HNetCfg.FwAuthorizedApplication")
•  oApp.Name=oFile.Name
•  oApp.ProcessImageFileName=CurrentDirectory+oFile.Name
•      oApp.Scope=NET_FW_SCOPE_ALL
•  'oApp.IpVersion = NET_FW_IP_VERSION_ANY
•        oApp.Enabled = TRUE 
•  Dim oProfile
•  Set oProfile=oFWMgr.LocalPolicy.CurrentProfile
•  oProfile.AuthorizedApplications.Add oApp
•  End if
•Next

•Msgbox "All the exe are added to the execption list of Firewall"


上一篇:beam和fusion的连接问题
下一篇:如何用命令行跑分析?