專業(yè)的三維3D設(shè)計軟件-SolidWorks 2022sp5綠色版

[重要通告]如您遇疑難雜癥,本站支持知識付費業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時間哦!

SolidWorks的安裝特別麻煩,精簡版的系統(tǒng)里居然裝不出來,比如在有.NET4.8的環(huán)境下會出現(xiàn)安裝錯誤等,所以制作了這個綠色版SolidWorks2022sp5綠色版;

SolidWorks是一款專業(yè)的三維3D設(shè)計軟件,功能強(qiáng)悍,支持分布式數(shù)據(jù)管理,支持直接處理網(wǎng)格數(shù)據(jù),提供更多的數(shù)據(jù)的靈活性,使用起來高效便捷??梢詭椭脩糨p松進(jìn)行3D CAD設(shè)計、機(jī)械設(shè)計、鈑金設(shè)計、模擬設(shè)計、電氣設(shè)計、PDM數(shù)據(jù)管理、CAM加工等。

安裝時除了主程序和語言,只選擇simulation和motion這兩個選項,綠化前必須先安裝VC庫和.net4.8環(huán)境,但軟件自身要求了必須安裝net4.8環(huán)境,以免一些功能無法使用。

壓縮包解壓在任意位置,進(jìn)入文件夾,運行最后一個VBS:雙擊靜默安裝.vbs,在I5 9400電腦上接近30秒完成綠化出現(xiàn)桌面圖標(biāo)。第一次進(jìn)系統(tǒng)時會有一個許可提示,再次進(jìn)入后不會再出現(xiàn)。

SolidWorks 2022sp5綠色版下載地址: https://www.123pan.com/s/p00rVv-1UqtH? 提取碼:6666

如需更改位置,可卸載重啟后移動或更名文件夾重新再次運行安裝程序。在火絨下安裝沒什么問題,但如果是360還是建議關(guān)閉掉再安裝。

針對程序連網(wǎng)的情況,使用防火墻安全策略,把所有程序EXE可執(zhí)行程序都禁止連網(wǎng),能正常進(jìn)入,但不確定是否會影響一些功能,需要的自行把以下內(nèi)容復(fù)制粘貼到安裝的VBS中替換以前內(nèi)容:

Dim WshShell,objFSO,ver,ie,reg,windir,srv_dict,firewall_dict,objWMIService,Shell,obj(),objRegistry
Set WshShell=WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\.")
Set Shell=CreateObject("Shell.Application")
Set srv_dict=CreateObject("Scripting.Dictionary") '需調(diào)整的服務(wù)
Set firewall_dict=CreateObject("Scripting.Dictionary")'需禁止接連網(wǎng)絡(luò)的程序
Set objRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Set objWMI = GetObject("Winmgmts:\\.\Root\Cimv2")
Set firewall_dict=CreateObject("Scripting.Dictionary")
Set colOperatingSystems = objWMIService.InstancesOf("Win32_OperatingSystem")
If WScript.Arguments.length = 0 Then
Shell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
WScript.quit
End If

my_dir=left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"")-1) '& "" '找到程序所在目錄
For Each objOperatingSystem In colOperatingSystems
windir=objOperatingSystem.WindowsDirectory
Next
prog_dir=WshShell.ExpandEnvironmentStrings("%ProgramFiles%")
prog86_dir=WshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
user_dir=WshShell.ExpandEnvironmentStrings("%USERPROFILE%")
pub_dir=WshShell.ExpandEnvironmentStrings("%PUBLIC%")
data_dir=WshShell.ExpandEnvironmentStrings("%ProgramData%")

 

Set tmp1 = objFSO.OpenTextFile(my_dir & "\setup.reg", 1) '讀入舊的文件
tmp2=tmp1.ReadAll:tmp1.close
del my_dir & "\安裝修改.reg"
if my_dir<>"D:\Program Files\SOLIDWORKS Corp" then
tmp2=replace(tmp2,"D:\Program Files\SOLIDWORKS Corp\SOLIDWORKS",my_dir)
bingpath=replace(my_dir,"","\")
tmp2=replace(tmp2,"D:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS",bingpath)
bingpath=replace(my_dir,"","/")
tmp2=replace(tmp2,"D:/Program Files/SOLIDWORKS Corp/SOLIDWORKS",bingpath)
end if

'"Toolbox Data Location"="d:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS Data\"
'bingpath="""Toolbox Data Location""=""D:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS Data"""
'tmp3="""Toolbox Data Location""=" & chr(34) & replace(my_dir,"","\") & chr(34)
'tmp2=replace(tmp2,bingpath,tmp3)'單獨替換ToolBox路徑

if windir<>"C:\\Windows" then
tmp2=replace(tmp2,"C:\\Windows",replace(windir,"","\"))
tmp2=replace(tmp2,"C:/Windows",replace(windir,"","/"))
end if
move_dir my_dir & "\Windows", windir
bingpath=replace(prog_dir,"","\")
if bingpath<>"C:\\Program Files" then
tmp2=replace(tmp2,"C:\\Program Files",bingpath)
tmp3=UCase(left(bingpath,2))
if tmp3<>"C:" then tmp2=replace(tmp2,"C:\\PROGRA",tmp3 & "\\PROGRA")
end if
move_dir my_dir & "\Program Files", prog_dir
move_dir my_dir & "\Program Files (x86)", prog86_dir
move_dir my_dir & "\AppData", user_dir
if user_dir<>"C:\Users\AppData" then
tmp2=replace(tmp2,"C:\\Users\\AppData",replace(user_dir,"","\"))
end if
bingpath=replace(pub_dir,"","\")
if bingpath<>"C:\Users\Public" then
tmp2=replace(tmp2,"C:\\Users\\Public",bingpath)
end if
bingpath=replace(data_dir,"","\")
if bingpath<>"C:\\ProgramData" then tmp2=replace(tmp2,"C:\\ProgramData",bingpath)
move_dir my_dir & "\ProgramData", bingpath'"C:\\ProgramData"
Set tmp1=objFSO.OpenTextFile(my_dir & "\安裝修改.reg",8,True,0)
tmp1.Write tmp2:tmp1.close:set tmp1=nothing
ins= "regedit /s " & chr(34) & my_dir & "\安裝修改.reg" & chr(34)
WshShell.Run ins,1,true ' 調(diào)入注冊表
'為保證成功,正在嘗試停止以前安裝錯誤的服務(wù)...
Close_Process("net.exe") '關(guān)閉程序
Close_Process("sc.exe") '關(guān)閉程序
'嘗試刪除之前裝錯的服務(wù)...
WshShell.Run "net.exe stop " & chr(34) & "SolidWorks Flexnet Server" & chr(34),0,true
Wait("net.exe")
WshShell.Run "sc.exe delete " & chr(34) & "SolidWorks Flexnet Server" & chr(34),0,true
Wait("sc.exe")
WshShell.Run "net.exe stop " & chr(34) & "WFlexNet Licensing Service 64" & chr(34),0,true
Wait("net.exe")
WshShell.Run "sc.exe delete " & chr(34) & "WFlexNet Licensing Service 64" & chr(34),0,true
Wait("sc.exe")
WshShell.Run "net.exe stop " & chr(34) & "SolidWorks Licensing Service" & chr(34),0,true
Wait("net.exe")
WshShell.Run "sc.exe delete " & chr(34) & "SolidWorks Licensing Service" & chr(34),0,true
Wait("sc.exe")

'重新安裝服務(wù)
ins=my_dir & "\SolidWorks_Flexnet_Server"
ins=chr(34) & ins & "installs.exe" & chr(34) & " -c " & chr(34) & ins & "sw_d_SSQ.lic" & chr(34) & " -e " & chr(34) & ins & "lmgrd.exe" & chr(34) & " -l " & chr(34) & ins & "sw_d_SSQ.log" & chr(34) & " -n " & chr(34) & "SolidWorks Flexnet Server" & chr(34)
WshShell.Run ins,0,true
'啟動服務(wù)
WshShell.Run "net.exe start " & chr(34) & "SolidWorks Flexnet Server" & chr(34),0,true
'第2個服務(wù)
bingpath=WshShell.ExpandEnvironmentStrings("%CommonProgramFiles(x86)%\SolidWorks Shared\Service\SolidWorksLicensing.exe")
ins="sc create " & """SolidWorks Licensing Service"" binpath=" & chr(34) & bingpath & chr(34) & " start=auto displayname=""SolidWorks Licensing Service"""
WshShell.Run ins,0,true
ins="sc description " & """SolidWorks Licensing Service"" ""Provides authentication services for SolidWorks applications"""
WshShell.Run ins,0,true
WshShell.Run "net.exe start " & chr(34) & "SolidWorks Licensing Service" & chr(34),0,true
'第3個服務(wù)
bingpath=WshShell.ExpandEnvironmentStrings("%CommonProgramFiles%\Macrovision Shared\FlexNet Publisher\FNPLicensingService64.exe")
ins="sc create " & """WFlexNet Licensing Service 64"" binpath=" & chr(34) & bingpath & chr(34) & " start=auto displayname=""WFlexNet Licensing Service 64"""
WshShell.Run ins,0,true
ins="sc description " & """WFlexNet Licensing Service 64"" ""This service performs licensing functions on behalf of FlexNet enabled products."""
WshShell.Run ins,0,true
WshShell.Run "net.exe start " & chr(34) & "WFlexNet Licensing Service 64" & chr(34),0,true
'改配置文件:sldIM_installed.xml

WshShell.Run chr(34) & my_dir & "\sldProcMon.exe" & chr(34),1,true'初使化程序
'WshShell.Run chr(34) & my_dir & "\fontinst" & chr(34),0,true'安裝字體
Shortcut "SLDWORKS2022", my_dir & "\SLDWORKS.exe"'創(chuàng)建桌面圖標(biāo)

bingpath=chr(34) & prog_dir & "\Common Files\SOLIDWORKS Shared"
WshShell.Run "regsvr32.exe /s /u " & bingpath & "sldwinshellextu.dll" & chr(34),0,true
WshShell.Run "regsvr32.exe /s /u " & bingpath & "sldthumbnailprovider.dll" & chr(34),0,true
WshShell.Run "regsvr32.exe /s " & chr(34) & my_dir & "\swhtmlcontrol.dll" & chr(34),0,true
del my_dir & "\安裝修改.reg"
WshShell.Run "regsvr32.exe /s " & bingpath & "sldwinshellextu.dll" & chr(34),0,true
WshShell.Run "regsvr32.exe /s " & bingpath & "sldthumbnailprovider.dll" & chr(34),0,true

firewall_dict.add "SW2022_01",my_dir & "" & "DsgnChkRptView.exe"
firewall_dict.add "SW2022_02",my_dir & "" & "gabiswengine.exe"
firewall_dict.add "SW2022_03",my_dir & "" & "LocalSldService.exe"
firewall_dict.add "SW2022_04",my_dir & "" & "mg-tetra.exe"
firewall_dict.add "SW2022_05",my_dir & "" & "propertyManagerUpload.exe"
firewall_dict.add "SW2022_06",my_dir & "" & "RTLibraryManager.exe"
firewall_dict.add "SW2022_07",my_dir & "" & "SldBatchUploadPreprocessor.exe"
firewall_dict.add "SW2022_08",my_dir & "" & "sldbgproc.exe"
firewall_dict.add "SW2022_09",my_dir & "" & "sldCostingTemplateEditorAppU.exe"
firewall_dict.add "SW2022_10",my_dir & "" & "SLDEXITAPP.exe"
firewall_dict.add "SW2022_11",my_dir & "" & "sldphotoshopcon.exe"
firewall_dict.add "SW2022_12",my_dir & "" & "sldProcMon.exe"
firewall_dict.add "SW2022_13",my_dir & "" & "sldSettingsAdmin.exe"
firewall_dict.add "SW2022_14",my_dir & "" & "SldToolboxConfigure.exe"
firewall_dict.add "SW2022_15",my_dir & "" & "sldtoolboxupdater.exe"
firewall_dict.add "SW2022_16",my_dir & "" & "SLDWORKS.exe"
firewall_dict.add "SW2022_17",my_dir & "" & "sldworks_fs.exe"
firewall_dict.add "SW2022_18",my_dir & "" & "swShellFileLauncher.exe"
firewall_dict.add "SW2022_19",my_dir & "" & "swspmanager.exe"
firewall_dict.add "SW2022_20",my_dir & "" & "testconsole.exe"
firewall_dict.add "SW2022_21",my_dir & "" & "UtlReportViewer.exe"
firewall_dict.add "SW2022_22",my_dir & "" & "x264.exe"
firewall_dict.add "SW2022_23",my_dir & "" & "api\pidcollector.exe"
firewall_dict.add "SW2022_24",my_dir & "" & "api\HTMLHelp2x\innovahxreg.exe"
firewall_dict.add "SW2022_25",my_dir & "" & "cef\swCefSubProc.exe"
firewall_dict.add "SW2022_26",my_dir & "" & "CircuitWorksFull\circuitworks.exe"
firewall_dict.add "SW2022_27",my_dir & "" & "DriveWorksXpress\driveworksxpressdt.exe"
firewall_dict.add "SW2022_28",my_dir & "" & "dsgnchk\Dsgnchkbldu.exe"
firewall_dict.add "SW2022_29",my_dir & "" & "dsgnchk\DsgnChkDesignBinderu.exe"
firewall_dict.add "SW2022_30",my_dir & "" & "FloXpress\bin\efdsolver.exe"
firewall_dict.add "SW2022_31",my_dir & "" & "FloXpress\bin\ffmpeg.exe"
firewall_dict.add "SW2022_32",my_dir & "" & "myproducts\myproducts.exe"
firewall_dict.add "SW2022_33",my_dir & "" & "photoview\foundrycrashhandler.exe"
firewall_dict.add "SW2022_34",my_dir & "" & "photoview\photoview360.exe"
firewall_dict.add "SW2022_35",my_dir & "" & "photoview\photoview360_cl.exe"
firewall_dict.add "SW2022_36",my_dir & "" & "photoview\QtWebEngineProcess.exe"
firewall_dict.add "SW2022_37",prog_dir & "\Common Files\SOLIDWORKS Shared\sldShellExtServer.exe"
firewall_dict.add "SW2022_38",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\lmutil.exe"
firewall_dict.add "SW2022_39",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\swlmutil.exe"
firewall_dict.add "SW2022_40",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\swlmwiz.exe"
firewall_dict.add "SW2022_41",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\sldrx\sldrx.exe"
firewall_dict.add "SW2022_42",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\sldrx\sldrxET.exe"
firewall_dict.add "SW2022_43",prog_dir & "\Common Files\SOLIDWORKS Shared\2022\sldrx\sldrxmm.exe"
firewall_dict.add "SW2022_45",progx86_dir & "\Common Files\SOLIDWORKS Shared\Service\Service\SolidWorksLicensing.exe"
firewall_dict.add "SW2022_46",progx86_dir & "\Common Files\SOLIDWORKS 安裝管理程序\30.0\sldimdownloader.exe"
firewall_dict.add "SW2022_47",progx86_dir & "\Common Files\SOLIDWORKS 安裝管理程序\BackgroundDownloading\sldBgDwld.exe"
firewall_dict.add "SW2022_48",progx86_dir & "\Common Files\SOLIDWORKS 安裝管理程序\CheckForUpdates\sldCheckForUpdates.exe"
firewall_dict.add "SW2022_49",my_dir & "" & "setup\i386\copyoptwiz.exe"
firewall_dict.add "SW2022_50",my_dir & "" & "setup\i386\swactwiz.exe"
firewall_dict.add "SW2022_51",my_dir & "" & "setup\i386\swactwizhelpersc.exe"
firewall_dict.add "SW2022_52",my_dir & "" & "setup\i386\swactwiz_s.exe"
firewall_dict.add "SW2022_53",my_dir & "" & "setup\i386\swinstactsvc.exe"
firewall_dict.add "SW2022_54",my_dir & "" & "setup\i386\swlicservinst.exe"
firewall_dict.add "SW2022_55",my_dir & "" & "setup\i386\x86\swlicservinst.exe"
firewall_dict.add "SW2022_56",my_dir & "" & "Simulation\check.exe"
firewall_dict.add "SW2022_57",my_dir & "" & "Simulation\check_net.exe"
firewall_dict.add "SW2022_58",my_dir & "" & "Simulation\cos2abq.exe"
firewall_dict.add "SW2022_59",my_dir & "" & "Simulation\cos2ans.exe"
firewall_dict.add "SW2022_60",my_dir & "" & "Simulation\cos2nas.exe"
firewall_dict.add "SW2022_61",my_dir & "" & "Simulation\cos2pat.exe"
firewall_dict.add "SW2022_62",my_dir & "" & "Simulation\cos2xds.exe"
firewall_dict.add "SW2022_63",my_dir & "" & "Simulation\cwanalysisproc.exe"
firewall_dict.add "SW2022_64",my_dir & "" & "Simulation\cwbcbfmesh.exe"
firewall_dict.add "SW2022_65",my_dir & "" & "Simulation\cwmeshproc.exe"
firewall_dict.add "SW2022_66",my_dir & "" & "Simulation\dpost.exe"
firewall_dict.add "SW2022_67",my_dir & "" & "Simulation\dstar.exe"
firewall_dict.add "SW2022_68",my_dir & "" & "Simulation\fat.exe"
firewall_dict.add "SW2022_69",my_dir & "" & "Simulation\ghs3d.exe"
firewall_dict.add "SW2022_70",my_dir & "" & "Simulation\ghs3dv3.exe"
firewall_dict.add "SW2022_71",my_dir & "" & "Simulation\hstar.exe"
firewall_dict.add "SW2022_72",my_dir & "" & "Simulation\ids2cos.exe"
firewall_dict.add "SW2022_73",my_dir & "" & "Simulation\nstar.exe"
firewall_dict.add "SW2022_74",my_dir & "" & "Simulation\pre1.exe"
firewall_dict.add "SW2022_75",my_dir & "" & "Simulation\renum.exe"
firewall_dict.add "SW2022_76",my_dir & "" & "Simulation\SOLIDWORKS Simulation Network Share.exe"
firewall_dict.add "SW2022_77",my_dir & "" & "Simulation\star.exe"
firewall_dict.add "SW2022_78",my_dir & "" & "Simulation\stopt.exe"
firewall_dict.add "SW2022_79",my_dir & "" & "Simulation\stres.exe"
firewall_dict.add "SW2022_80",my_dir & "" & "Simulation\sysinf.exe"
firewall_dict.add "SW2022_81",my_dir & "" & "Simulation\License\setup\i386\swlicservinst.exe"
firewall_dict.add "SW2022_82",my_dir & "" & "Simulation\setup\i386\swactwiz.exe"
firewall_dict.add "SW2022_83",my_dir & "" & "Simulation\setup\i386\swlicservinst.exe"
firewall_dict.add "SW2022_84",my_dir & "" & "Simulation\Topology\code\bin\smatoctoscaservermain.exe"
firewall_dict.add "SW2022_85",my_dir & "" & "Simulation\Topology\code\bin\SMATrtOptResExportTool.exe"
firewall_dict.add "SW2022_86",my_dir & "" & "Simulation\Topology\code\bin\SMATrtOptResImportTool.exe"
firewall_dict.add "SW2022_87",my_dir & "" & "Simulation\Topology\code\bin\SMATrtOptResInfo.exe"
firewall_dict.add "SW2022_88",my_dir & "" & "Simulation\Topology\code\bin\smatrttstructsmoothmain.exe"
firewall_dict.add "SW2022_89",my_dir & "" & "Simulation\Topology\code\bin\smatsocosmosjobchecker.exe"
firewall_dict.add "SW2022_90",my_dir & "" & "Simulation\Topology\code\bin\smatsocosmossetlc.exe"
firewall_dict.add "SW2022_91",my_dir & "" & "Simulation\Topology\code\bin\smatsofeminclude.exe"
firewall_dict.add "SW2022_92",my_dir & "" & "Simulation\Topology\code\bin\smatsofemmodif.exe"
firewall_dict.add "SW2022_93",my_dir & "" & "Simulation\Topology\code\bin\smatsofemtoonf.exe"
firewall_dict.add "SW2022_94",my_dir & "" & "Simulation\Topology\code\bin\smatsorestovtm.exe"
firewall_dict.add "SW2022_95",my_dir & "" & "Simulation\Topology\code\bin\smatsotoscaopt.exe"
firewall_dict.add "SW2022_96",my_dir & "" & "Simulation\Topology\code\bin\smatsotoscaprep.exe"
firewall_dict.add "SW2022_97",my_dir & "" & "Simulation\Topology\code\bin\smatsotoscapython.exe"
firewall_dict.add "SW2022_98",my_dir & "" & "Simulation\Topology\tools\smapy\python\python.exe"
firewall_dict.add "SW2022_99",my_dir & "" & "Simulation\Topology\tools\smapy\python\pythonw.exe"
firewall_dict.add "SW2022_100",my_dir & "" & "Simulation\Utilities\cosmossupporttool.exe"
firewall_dict.add "SW2022_101",my_dir & "" & "Simulation\Utilities\material.exe"
firewall_dict.add "SW2022_102",my_dir & "" & "Simulation\Utilities\simulation cleaning utility.exe"
firewall_dict.add "SW2022_103",my_dir & "" & "sldBenchmarking\sldBenchmark.exe"
firewall_dict.add "SW2022_104",my_dir & "" & "sldPropertyTabBuilder\PropertyTabBuilder.exe"
firewall_dict.add "SW2022_105",my_dir & "" & "sldutils\GtReportManager.exe"
firewall_dict.add "SW2022_106",my_dir & "" & "SolidWorks_Flexnet_Server\installs.exe"
firewall_dict.add "SW2022_107",my_dir & "" & "SolidWorks_Flexnet_Server\lmgrd.exe"
firewall_dict.add "SW2022_108",my_dir & "" & "SolidWorks_Flexnet_Server\lmtools.exe"
firewall_dict.add "SW2022_109",my_dir & "" & "SolidWorks_Flexnet_Server\lmutil.exe"
firewall_dict.add "SW2022_110",my_dir & "" & "SolidWorks_Flexnet_Server\sw_d.exe"
firewall_dict.add "SW2022_111",my_dir & "" & "spiop\sldimport.exe"
firewall_dict.add "SW2022_112",my_dir & "" & "spiop\files\code\bin\cnextmproc.exe"
firewall_dict.add "SW2022_113",my_dir & "" & "spiop\files\code\bin\spaxchildconnect.exe"
firewall_dict.add "SW2022_114",my_dir & "" & "spiop\files\code\bin\spaxchildprocess.exe"
firewall_dict.add "SW2022_115",my_dir & "" & "spiop\files\code\bin\spaxchilduconnectacis.exe"
firewall_dict.add "SW2022_116",my_dir & "" & "spiop\files\code\bin\spaxchilduconnectcgm.exe"
firewall_dict.add "SW2022_117",my_dir & "" & "spiop\files\code\bin\spaxchilduconnectps.exe"
firewall_dict.add "SW2022_118",my_dir & "" & "swScheduler\DTSCoordinatorService.exe"
firewall_dict.add "SW2022_119",my_dir & "" & "swScheduler\DTSMonitor.exe"
firewall_dict.add "SW2022_120",my_dir & "" & "swScheduler\DTSServiceManager.exe"
firewall_dict.add "SW2022_121",my_dir & "" & "swScheduler\swboengine.exe"
firewall_dict.add "SW2022_122",my_dir & "" & "swScheduler\swScheduler.exe"
firewall_dict.add "SW2022_123",my_dir & "" & "swVBAServer\drawcompare.exe"
firewall_dict.add "SW2022_124",my_dir & "" & "ThemeEditor\PresentationStudioThemeEditor.exe"
firewall_dict.add "SW2022_125",my_dir & "" & "Toolbox\data utilities\DatabaseConverter.exe"
firewall_dict.add "SW2022_126",my_dir & "" & "Toolbox\data utilities\sldsetdocprop.exe"
firewall_dict.add "SW2022_127",my_dir & "" & "Toolbox\data utilities\UpdateBrowserDatabase.exe"
firewall_dict.add "SW2022_128",my_dir & "" & "Treehouse\Treehouse.exe"
firewall_dict.add "SW2022_129",windir & "" & "SolidWorks\IM_20220-40500-1100-100\setup.exe"
firewall_dict.add "SW2022_130",windir & "" & "SolidWorks\IM_20220-40500-1100-100\sldim\sldadminoptioneditor.exe"
firewall_dict.add "SW2022_131",windir & "" & "SolidWorks\IM_20220-40500-1100-100\sldim\sldIM.exe"

For Each i in firewall_dict'禁止程序連網(wǎng)
firewall_dict(i)=WshShell.ExpandEnvironmentStrings(firewall_dict(i))
'netsh advfirewall firewall del rule name=i
tmp1=" del rule name=" & chr(34) & i & chr(34)
'netsh advfirewall firewall add rule name=i program=i action=block dir=out
tmp2=" add rule name=" & chr(34) & i & chr(34) & " program=" & chr(34) & firewall_dict(i) & chr(34) & " action=block dir=out"
'netsh advfirewall firewall add rule name=i service=%%j action=block dir=out program="%svchost_exe%"
tmp3=" add rule name=" & chr(34) & i & chr(34) & " service=" & chr(34) & firewall_dict(i) & chr(34) & " action=block dir=out program=" & chr(34) & windir & "\system32\svchost.exe" & chr(34)
WshShell.Run "netsh advfirewall firewall " & tmp1 ,0,true '刪除之前規(guī)則
WshShell.Run "netsh advfirewall firewall " & tmp2 ,0,true '建立新規(guī)則
if i="Windows Update" then WshShell.Run "netsh advfirewall firewall " & tmp3 ,0,true '添加阻止服務(wù)出站規(guī)則
next

i=WshShell.popup("工作完成,確認(rèn)或無操作5秒后運行SW2022,如不需要請及時取消",5,"SolidWorks安裝程序",VbOKCancel)
if i=vbOK or i=-1 then WshShell.Run my_dir & "\SLDWORKS.exe",1,true
Wscript.Quit

 

Function move_dir(dir0,dir1)'dir0:原目錄;dir1:移動過去的新目錄
dim file,fs,items,objdir
dir1=UCase(trim(dir1)):if right(dir1,1)="" then dir1=left(dir1,len(dir1)-1) '容錯去空格和后\
dir0=UCase(trim(dir0)):if right(dir0,1)="" then dir0=left(dir0,len(dir0)-1) '容錯去空格和后\
fs = Split(dir1, "")
for each file in fs
if not file=nul then items=items&file&""
if not objFSO.FileExists(items&"\nul") then Set objdir = objFSO.CreateFolder(items)
next
objdir=left(dir1,instrrev(dir1,"")-1) '& ""
fs=right(dir1,len(dir1)-len(objdir))
if fs=right(dir0,len(fs)) then
dir1=objdir
if right(dir1,1)=":" then dir1=dir1 & ""
end if
'CreateObject("Shell.Application").NameSpace(dir1).MoveHere dir0,&H0&'FOF_CREATEPROGRESSDLG
'上述方法不能直接覆蓋,所以只能用復(fù)制和刪除
on error resume next
objFSO.CopyFolder dir0,dir1,True '復(fù)制目錄里的文件到新的地方
'del(dir0)'暫時不忙刪除,萬一需要重復(fù)安裝?
on error goto 0
End Function

 

 

 

 

 

 

Function NetWork(val) '因未設(shè)置延遲,所以不要重復(fù)調(diào)用或在短時內(nèi)操作網(wǎng)絡(luò)
'接收參數(shù):0:關(guān)閉“本地連接” 1:打開“本地連接” 2:自動(關(guān)閉則打開;打開則關(guān)閉)
dim w,i
Set w=objWMI.ExecQuery("select * from WIN32_NetworkAdapter")
For Each i In w
If instr(i.NetConnectionID,"本地連接")>0 or instr(i.NetConnectionID,"以太網(wǎng)")>0 Then
if val=0 then i.Disable
if val=1 then i.Enable
if val=2 then
If i.NetConnectionStatus<>0 then
i.Disable
Else
i.Enable
end if
end if
End If
next
set w=nothing
'wscript.sleep 400
End Function

Function Wait(proc) '等待程序完成,十秒還沒完成則退出
dim mark,obj,proce,data,x
do
mark=0
Set obj = getobject("winmgmts:\\.\root\cimv2")
Set proce = obj.execquery("select * from win32_process")
For each x in proce
if lcase(x.name)=proc then mark=1
data=data+1
next
if mark=0 or data>100 then exit do
wscript.sleep 100
Set obj = nothing
Set proce = nothing
loop
End Function

'關(guān)閉程序
Function Close_Process(ProcessName) '關(guān)閉程序
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & ProcessName & "'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
End Function

Function Shortcut(Short_name,path_and_name) '為在桌面創(chuàng)建一個快捷方式
strDesktop = WshShell.SpecialFolders("AllUsersDesktop") '在桌面創(chuàng)建一個快捷方式
set oShellLink = WshShell.CreateShortcut(strDesktop & "" & Short_name & ".lnk") '名稱
oShellLink.TargetPath = path_and_name '目標(biāo)
oShellLink.WindowStyle = 1 '窗口樣式 1默認(rèn)窗口激活,參數(shù)3最大化激活,參數(shù)7最小化
oShellLink.Hotkey = "" '快捷鍵
oShellLink.IconLocation = path_and_name & ",0" '第幾個圖標(biāo)
oShellLink.Description = Short_name '備注
oShellLink.WorkingDirectory = left(path_and_name,InStrRev(path_and_name,"")-1) '起始位置
oShellLink.Arguments = "" '參數(shù)
oShellLink.Save '保存
End Function

Function del(del_file) '刪除文件或者文件夾,之所以最后一種可能實現(xiàn)前兩種功能還要分開成三種,是因為效率
dim file_path,str2,str3,pattern,tmp1,tmp2,tmp3
tmp2="":tmp3="" '初使化臨時變量
del_file=WshShell.ExpandEnvironmentStrings(trim(del_file))'還原帶環(huán)境變量,去掉空格,下面這句設(shè)置解屬性參數(shù),其中SID在上文已定義
file_path = lcase(objFSO.GetParentFolderName(del_file)) '取父目錄方法
if del_file="" then del="調(diào)用時沒寫被刪除的文件":exit Function
if not objFSO.FolderExists(file_path) then del="沒找到父文件夾:" & del_file :exit Function
on error resume next
WshShell.Run "takeown.exe /f " & chr(34) & windir & del_file & chr(34),0,true
WshShell.Run "icacls.exe /f " & chr(34) & windir & del_file & chr(34) & " /grant administrators:F",0,true
objFSO.deletefile del_file,true '用通配符刪除文件
objFSO.deletefolder del_file,true '直接刪除文件夾
on error goto 0
End Function

Function SRV_ADD(Service_Name,mode)
'Set tmp=GetObject("winmgmts:\\.\root\cimv2").get("win32_service")
'uu=tmp.create("WFlexNet Licensing Service 64","FlexNet Licensing Service 64","C:\Program Files\Common Files\Macrovision Shared\FlexNet 'Publisher\FNPLicensingService64.exe",16,2,"Manual",True,Null,null)
'Set tmp=nothing
End Function

'例:Call SRV("RemoteAccess","del")
Function SRV(Service_Name,mode)'設(shè)置系統(tǒng)服務(wù),stop:停,Start:啟,del:刪,Disabled:禁,Automatic:自動,Manual:手動,delayed-auto延遲啟動
dim ObjServices,SRV_msg'返回值:正常完成/操作值錯mode/無此服務(wù)
Set ObjServices = GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_Service where Name="&"'"&Service_Name &"'")
SRV="未找到" & Service_Name:FOREXIT=0
For Each Service In ObjServices
SRV="有服務(wù)" & Service_Name
Service_mode=LCase(mode)'默認(rèn)手工啟動,是否考慮預(yù)置Start=3 ?
Select Case LCase(Service_mode)
Case "stop"'停止服務(wù)
Call Service.StopService()
Start=0
'If Service.State = "Running" Then '不同服務(wù)停下來時間不一樣
Case "start"'啟動服務(wù)
Call Service.Start()
Start=0
Case "del"'刪除服務(wù)
Start=6
Case "demand"'手動
Start = 3
Case "auto"'自動啟動
Start = 2
Service_mode="Automatic"
Case "delayed-auto"'延遲啟動
Start = 5
Service_mode="Automatic"
Case "disabled"'禁用
Start = 4
Service_mode="Disabled"
case else
SRV="操作錯" & mode
Start=0
End Select
if Start>0 then
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Services",arrSubKeys
SRV="無服務(wù)" & Service_Name
For Each subkey In arrSubKeys
SRV="找到有" & Service_Name
if subkey=Service.Name then
if Start=6 then '單獨處理刪除服務(wù)
SRV_reg="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" & subkey & "\Start"
Service.StopService() '防火墻服務(wù)必須停止后才能刪除,其他大多不必
Service.Delete():SRV="刪成功" & subkey'刪除本服務(wù)
SRV_msg="":on error resume next:SRV_msg=WshShell.RegRead(SRV_reg):on error goto 0'嘗試讀這個服務(wù)
if SRV_msg>"" then'如果這個服務(wù)仍然沒被刪除就解除注冊表權(quán)限然后嘗試直接刪除注冊表
SetRegACL "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"& subkey
oReg.deletekey HKEY_LOCAL_MACHINE ,"SYSTEM\CurrentControlSet\Services" & subkey
SRV_msg="":on error resume next:SRV_msg=WshShell.RegRead(SRV_reg):on error goto 0'嘗試讀這個服務(wù)
if SRV_msg>"" then '嘗試使用Reg命令
'msgbox "cmd /c reg delete ""HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" & subkey & """ /f"
WshShell.Run "cmd /c reg delete ""HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" & subkey & """ /f",0,true
SRV_msg="":on error resume next:SRV_msg=WshShell.RegRead(SRV_reg):on error goto 0'嘗試讀這個服務(wù)
if SRV_msg>"" then SRV="刪失敗" & subkey else SRV="刪成功" & subkey
end if
end if
else
'Service.ChangeStartMode(Service_mode)'本來用這句就可以了,能得到最好的兼容性,但權(quán)限問題會造成不確定的無效
Delay=0:if start=5 then Delay=1:Start=2'預(yù)設(shè)不延時啟動(具體秒在Control\AutoStartDelay)
TryWrtReg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" & subkey & "\DelayedAutostart",Delay,"REG_DWORD"
TryWrtReg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" & subkey & "\Start" ,Start,"REG_DWORD"
end if
FOREXIT=1'只可能有一個同名服務(wù),不需要完成所有循環(huán)
end if
if FOREXIT=1 then exit for
Next
end if
if FOREXIT=1 then exit for
Next
Set ObjServices = nothing
End Function

問題未解決?付費解決問題加Q或微信 2589053300 (即Q號又微信號)右上方掃一掃可加博主微信

所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!

支付寶贊助
微信贊助

免責(zé)聲明,若由于商用引起版權(quán)糾紛,一切責(zé)任均由使用者承擔(dān)。

您必須遵守我們的協(xié)議,如您下載該資源,行為將被視為對《免責(zé)聲明》全部內(nèi)容的認(rèn)可->聯(lián)系老梁投訴資源
LaoLiang.Net部分資源來自互聯(lián)網(wǎng)收集,僅供用于學(xué)習(xí)和交流,請勿用于商業(yè)用途。如有侵權(quán)、不妥之處,請聯(lián)系站長并出示版權(quán)證明以便刪除。 敬請諒解! 侵權(quán)刪帖/違法舉報/投稿等事物聯(lián)系郵箱:service@laoliang.net
意在交流學(xué)習(xí),歡迎贊賞評論,如有謬誤,請聯(lián)系指正;轉(zhuǎn)載請注明出處: » 專業(yè)的三維3D設(shè)計軟件-SolidWorks 2022sp5綠色版

發(fā)表回復(fù)

本站承接,網(wǎng)站推廣(SEM,SEO);軟件安裝與調(diào)試;服務(wù)器或網(wǎng)絡(luò)推薦及配置;APP開發(fā)與維護(hù);網(wǎng)站開發(fā)修改及維護(hù); 各財務(wù)軟件安裝調(diào)試及注冊服務(wù)(金蝶,用友,管家婆,速達(dá),星宇等);同時也有客戶管理系統(tǒng),人力資源,超市POS,醫(yī)藥管理等;

立即查看 了解詳情