•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"
|