如何把Moldflow所有程序加入防火墻
發(fā)布者:cadit 發(fā)布時間:2016/1/18 閱讀:3940 次

?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的連接問題
下一篇:如何用命令行跑分析?