golang开发一个自动修复系统错误,发现有缺失的dll会进行安装,干货满满,[强烈建议收藏]

golang代码如下:

package main

import (
    "fmt"
    "golang.org/x/sys/windows/registry"
    "io"
    "log"
    "net/http"
    "os"
    "os/exec"
    "path/filepath"
    "strings"
    "time"
)

// 重启计算机
func ReShutDownEXE() {
    fmt.Println("重启主机")
    arg := []string{"-r", "-t", "20"}
    cmd := exec.Command("shutdown", arg...)
    d, err := cmd.CombinedOutput()
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    fmt.Println(string(d))
    return
}
func IsExit(fileName string) bool {
    filePathName := "C:/Windows/System32/" + fileName
    _, err := os.Stat(filePathName)
    if err == nil {
        return true
    }
    return false
}

func RemoveFile(path string) error {
    _err := os.Remove(path)
    return _err
}

func downFileToSysDir(url string, filepath string) {
    //url := "http://files.saas.hand-china.com/java/sales-hardware-management.pdf"
    //filepath := "sales-hardware-management.pdf"

    response, err := http.Get(url)
    if err != nil {
        fmt.Println("Error fetching response. ", err)
        return
    }
    defer response.Body.Close()

    out, err := os.Create(filepath)
    if err != nil {
        fmt.Println("Error creating file. ", err)
        return
    }
    defer out.Close()

    _, err = io.Copy(out, response.Body)
    if err != nil {
        fmt.Println("Error saving file. ", err)
        return
    }

    //fmt.Println("File saved successfully.")
}

func main() {

    k, err33 := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
    if err33 != nil {
        log.Fatal(err33)
    }
    defer k.Close()

    pn, _, err33 := k.GetStringValue("ProductName")
    if err33 != nil {
        log.Fatal(err33)
    }
    var sysProductName string = "11"
    if strings.Contains(pn, "7") {
        sysProductName = "7"
    }
    if strings.Contains(pn, "8") {
        sysProductName = "8"
    }

    //fmt.Printf("ProductName: %s\n", pn)

    /*
        maj, _, err := k.GetIntegerValue("CurrentMajorVersionNumber")
        if err != nil {
            log.Fatal(err)
        }

            fmt.Printf("CurrentMajorVersionNumber: %d\n", maj)

            min, _, err := k.GetIntegerValue("CurrentMinorVersionNumber")
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("CurrentMinorVersionNumber: %d\n", min)

            cb, _, err := k.GetStringValue("CurrentBuild")
            if err != nil {
                log.Fatal(err)
            }
            fmt.Printf("CurrentVersion: %s\n", cb)
    */
    var isNeedReboot = 0
    if sysProductName == "7" || sysProductName == "8" {
        println("win7和win8系统要进行安装dll文件,安装结束,系统要重启电脑")
        time.Sleep(1 * time.Second)
        println("不要关闭此窗口,程序要进行修复dll文件")
        time.Sleep(1 * time.Second)

    } else {
        println("ProductName: %s\n", pn)
        println("系统不需要修复dll文件")
        time.Sleep(6 * time.Minute)

        os.Exit(1)
    }

    /*
        // 获取当前进程的工作目录
        dir, err := os.Getwd()
        if err != nil {
            fmt.Println(err)
        }
        fmt.Println("Current working directory:", dir)
    */

    // 将相对文件路径转换成绝对文件路径
    dllPath, err := filepath.Abs("win7")
    if err != nil {
        fmt.Println(err)
    }

    err2 := os.MkdirAll(dllPath, 0766)
    if err2 != nil {
        fmt.Println(err2)
    }

    var dll_all_name string = "api-ms-win-core-path-l1-1-0.dll,AUDIOKSE.dll,ActionCenterCPL.dll,ActionQueue.dll,AdmTmpl.dll,AppIdPolicyEngineApi.dll,Apphlpdm.dll,AudioEng.dll,AudioSes.dll,AuditNativeSnapIn.dll,AuditPolicyGPInterop.dll,AuthFWGP.dll,AuthFWSnapin.dll,AuthFWWizFwk.dll,AxInstSv.dll,AzSqlExt.dll,BFE.DLL,BOOTVID.DLL,BWContextHandler.dll,BthMtpContextHandler.dll,BthpanContextHandler.dll,CHxReadingStringIME.dll,CIRCoInst.dll,COLORCNV.DLL,CPFilters.dll,CertEnroll.dll,CertEnrollUI.dll,CertPolEng.dll,CscMig.dll,D3DCompiler_47.dll,DDACLSys.dll,DDOIProxy.dll,DDORes.dll,DWrite.dll,DXP.dll,DeviceCenter.dll,DeviceDisplayStatusManager.dll,DevicePairing.dll,DevicePairingFolder.dll,DevicePairingProxy.dll,DeviceUxRes.dll,DfsShlEx.dll,DiagCpl.dll,Display.dll,DocumentPerformanceEvents.dll,DxpTaskSync.dll,ELSCore.dll,EhStorAPI.dll,EhStorPwdMgr.dll,EhStorShell.dll,EventViewer_EventDetails.xsl,ExplorerFrame.dll,FDResPub.dll,FNTCACHE.DAT,FWPUCLNT.DLL,Faultrep.dll,Firewall.cpl,FirewallAPI.dll,FirewallControlPanel.dll,FntCache.dll,FwRemoteSvr.dll,Groupinghc.dll,HelpPaneProxy.dll,IDStore.dll,IEAdvpack.dll,IKEEXT.DLL,INETRES.dll,IPHLPAPI.DLL,IPSECSVC.DLL,IasMigPlugin.dll,IconCodecService.dll,InkEd.dll,JavaScriptCollectionAgent.dll,KBDA1.DLL,KBDA2.DLL,KBDA3.DLL,KBDAL.DLL,KBDARME.DLL,KBDARMW.DLL,KBDAZE.DLL,KBDAZEL.DLL,KBDBASH.DLL,KBDBE.DLL,KBDBENE.DLL,KBDBGPH.DLL,KBDBGPH1.DLL,KBDBHC.DLL,KBDBLR.DLL,KBDBR.DLL,KBDBU.DLL,KBDBULG.DLL,KBDCA.DLL,KBDCAN.DLL,KBDCR.DLL,KBDCZ.DLL,KBDCZ1.DLL,KBDCZ2.DLL,KBDDA.DLL,KBDDIV1.DLL,KBDDIV2.DLL,KBDDV.DLL,KBDES.DLL,KBDEST.DLL,KBDFA.DLL,KBDFC.DLL,KBDFI.DLL,KBDFI1.DLL,KBDFO.DLL,KBDFR.DLL,KBDGAE.DLL,KBDGEO.DLL,KBDGKL.DLL,KBDGR.DLL,KBDGR1.DLL,KBDGRLND.DLL,KBDHAU.DLL,KBDHE.DLL,KBDHE220.DLL,KBDHE319.DLL,KBDHEB.DLL,KBDHELA2.DLL,KBDHELA3.DLL,KBDHEPT.DLL,KBDHU.DLL,KBDHU1.DLL,KBDIBO.DLL,KBDIC.DLL,KBDINASA.DLL,KBDINBE1.DLL,KBDINBE2.DLL,KBDINBEN.DLL,KBDINDEV.DLL,KBDINEN.DLL,KBDINGUJ.DLL,KBDINHIN.DLL,KBDINKAN.DLL,KBDINMAL.DLL,KBDINMAR.DLL,KBDINORI.DLL,KBDINPUN.DLL,KBDINTAM.DLL,KBDINTEL.DLL,KBDINUK2.DLL,KBDIR.DLL,KBDIT.DLL,KBDIT142.DLL,KBDIULAT.DLL,KBDJPN.DLL,KBDKAZ.DLL,KBDKHMR.DLL,KBDKOR.DLL,KBDKYR.DLL,KBDLA.DLL,KBDLAO.DLL,KBDLT.DLL,KBDLT1.DLL,KBDLT2.DLL,KBDLV.DLL,KBDLV1.DLL,KBDMAC.DLL,KBDMACST.DLL,KBDMAORI.DLL,KBDMLT47.DLL,KBDMLT48.DLL,KBDMON.DLL,KBDMONMO.DLL,KBDNE.DLL,KBDNEPR.DLL,KBDNO.DLL,KBDNO1.DLL,KBDNSO.DLL,KBDPASH.DLL,KBDPL.DLL,KBDPL1.DLL,KBDPO.DLL,KBDRO.DLL,KBDROPR.DLL,KBDROST.DLL,KBDRU.DLL,KBDRU1.DLL,KBDSF.DLL,KBDSG.DLL,KBDSL.DLL,KBDSL1.DLL,KBDSMSFI.DLL,KBDSMSNO.DLL,KBDSN1.DLL,KBDSOREX.DLL,KBDSORS1.DLL,KBDSORST.DLL,KBDSP.DLL,KBDSW.DLL,KBDSW09.DLL,KBDSYR1.DLL,KBDSYR2.DLL,KBDTAJIK.DLL,KBDTAT.DLL,KBDTH0.DLL,KBDTH1.DLL,KBDTH2.DLL,KBDTH3.DLL,KBDTIPRC.DLL,KBDTUF.DLL,KBDTUQ.DLL,KBDTURME.DLL,KBDUGHR.DLL,KBDUGHR1.DLL,KBDUK.DLL,KBDUKX.DLL,KBDUR.DLL,KBDUR1.DLL,KBDURDU.DLL,KBDUS.DLL,KBDUSA.DLL,KBDUSL.DLL,KBDUSR.DLL,KBDUSX.DLL,KBDUZB.DLL,KBDVNTC.DLL,KBDWOL.DLL,KBDYAK.DLL,KBDYBA.DLL,KBDYCC.DLL,KBDYCL.DLL,KernelBase.dll,Kswdmcap.ax,L2SecHC.dll,LAPRXY.DLL,LSCSHostPolicy.dll,LangCleanupSysprepAction.dll,MFPlay.dll,MFWMAAEC.DLL,MMDevAPI.dll,MP3DMOD.DLL,MP43DECD.DLL,MP4SDECD.DLL,MPG4DECD.DLL,MPSSVC.dll,MSAC3ENC.DLL,MSDvbNP.ax,MSMPEG2ENC.DLL,MSNP.ax,MSVidCtl.dll,MUILanguageCleanup.dll,Magnification.dll,Mpeg2Data.ax,MsCtfMonitor.dll,MsRdpWebAccess.dll,MshtmlDac.dll,MsiCofire.dll,MsraLegacy.tlb,Mystify.scr,NAPCRYPT.DLL,NOISE.CHS,NapiNSP.dll,NaturalLanguage6.dll,NcdProp.dll,Nlsdl.dll,OpcServices.dll,P2P.dll,P2PGraph.dll,PNPXAssoc.dll,PNPXAssocPrx.dll,PSHED.DLL,PeerDist.dll,PeerDistHttpTrans.dll,PeerDistSh.dll,PeerDistSvc.dll,PeerDistWSDDiscoProv.dll,PerfStringBackup.INI,PhotoMetadataHandler.dll,PlaySndSrv.dll,Pnrphc.dll,PortableDeviceApi.dll,PortableDeviceClassExtension.dll,PortableDeviceConnectApi.dll,PortableDeviceStatus.dll,PortableDeviceSyncProvider.dll,PortableDeviceTypes.dll,PortableDeviceWiaCompat.dll,PresentationCFFRasterizerNative_v0300.dll,PresentationHostProxy.dll,PresentationNative_v0300.dll,PrintIsolationProxy.dll,Query.dll,RASMM.dll,RESAMPLEDMO.DLL,ReAgent.dll,RegCtrl.dll,RestartManager.mof,RestartManagerUninstall.mof,RpcEpMap.dll,RpcNs4.dll,RpcRtRemote.dll,RstrtMgr.dll,SCardDlg.dll,SCardSvr.dll,SMBHelperClass.dll,SPInf.dll,SSShim.dll,SearchFolder.dll,Sens.dll,SensApi.dll,SensorsApi.dll,SensorsClassExtension.dll,SensorsCpl.dll,SessEnv.dll,ShiftJIS.uce,SmartcardCredentialProvider.dll,SmiEngine.dll,SndVolSSO.dll,SortServer2003Compat.dll,SortWindows6Compat.dll,SrpUxNativeSnapIn.dll,StorSvc.dll,StorageContextHandler.dll,Storprop.dll,StructuredQuery.dll,SubRange.uce,SyncCenter.dll,SyncHostps.dll,SyncInfrastructure.dll,SyncInfrastructureps.dll,Syncreg.dll,TSErrRedir.dll,TSWorkspace.dll,TSpkg.dll,TabSvc.dll,TapiMigPlugin.dll,TapiSysprep.dll,TaskSchdPS.dll,TimeDateMUICallback.dll,TsUsbGDCoInstaller.dll,TsUsbRedirectionGroupPolicyExtension.dll,UIAnimation.dll,UIAutomationCore.dll,UIRibbon.dll,UIRibbonRes.dll,UXInit.dll,UserAccountControlSettings.dll,VAN.dll,VBICodec.ax,VIDRESZR.DLL,Vault.dll,WABSyncProvider.dll,WINSRPC.DLL,WLanConn.dll,WLanHC.dll,WMADMOD.DLL,WMADMOE.DLL,WMASF.DLL,WMNetMgr.dll,WMPhoto.dll,WMSPDMOD.DLL,WMSPDMOE.DLL,WMVCORE.DLL,WMVDECOD.DLL,WMVENCOD.DLL,WMVSDECD.DLL,WMVSENCD.DLL,WMVXENCD.DLL,WPDShServiceObj.dll,WPDSp.dll,WSDApi.dll,WSDPrintProxy.DLL,WSDScanProxy.dll,WSHTCPIP.DLL,WSManMigrationPlugin.dll,WSTPager.ax,WUDFCoinstaller.dll,WUDFPlatform.dll,WUDFx.dll,WWanAPI.dll,WWanHC.dll,WcnApi.dll,WcnEapAuthProxy.dll,WcnEapPeerProxy.dll,WcnNetsh.dll,WebClnt.dll,WfHC.dll,WiaExtensionHost64.dll,WinSCard.dll,WinSync.dll,WinSyncMetastore.dll,WinSyncProviders.dll,WindowsCodecs.dll,WindowsCodecsExt.dll,WlanMM.dll,Wldap32.dll,Wpc.dll,WsmAuto.dll,WsmPty.xsl,WsmRes.dll,WsmSvc.dll,WsmTxt.xsl,WsmWmiPl.dll,XInput9_1_0.dll,XpsGdiConverter.dll,XpsPrint.dll,XpsRasterService.dll,acledit.dll,aclui.dll,acppage.dll,acproxy.dll,activeds.dll,activeds.tlb,actxprxy.dll,adprovider.dll,adsldp.dll,adsldpc.dll,adsmsext.dll,adsnt.dll,adtschema.dll,advapi32.dll,advpack.dll,aeevts.dll,aepic.dll,amstream.dll,apds.dll,api-ms-win-core-console-l1-1-0.dll,api-ms-win-core-datetime-l1-1-0.dll,api-ms-win-core-debug-l1-1-0.dll,api-ms-win-core-errorhandling-l1-1-0.dll,api-ms-win-core-file-l1-1-0.dll,api-ms-win-core-file-l1-2-0.dll,api-ms-win-core-file-l2-1-0.dll,api-ms-win-core-handle-l1-1-0.dll,api-ms-win-core-heap-l1-1-0.dll,api-ms-win-core-interlocked-l1-1-0.dll,api-ms-win-core-libraryloader-l1-1-0.dll,api-ms-win-core-localization-l1-2-0.dll,api-ms-win-core-memory-l1-1-0.dll,api-ms-win-core-namedpipe-l1-1-0.dll,api-ms-win-core-processenvironment-l1-1-0.dll,api-ms-win-core-processthreads-l1-1-0.dll,api-ms-win-core-processthreads-l1-1-1.dll,api-ms-win-core-profile-l1-1-0.dll,api-ms-win-core-rtlsupport-l1-1-0.dll,api-ms-win-core-string-l1-1-0.dll,api-ms-win-core-synch-l1-1-0.dll,api-ms-win-core-synch-l1-2-0.dll,api-ms-win-core-sysinfo-l1-1-0.dll,api-ms-win-core-timezone-l1-1-0.dll,api-ms-win-core-util-l1-1-0.dll,api-ms-win-crt-conio-l1-1-0.dll,api-ms-win-crt-convert-l1-1-0.dll,api-ms-win-crt-environment-l1-1-0.dll,api-ms-win-crt-filesystem-l1-1-0.dll,api-ms-win-crt-heap-l1-1-0.dll,api-ms-win-crt-locale-l1-1-0.dll,api-ms-win-crt-math-l1-1-0.dll,api-ms-win-crt-private-l1-1-0.dll,api-ms-win-crt-process-l1-1-0.dll,api-ms-win-crt-runtime-l1-1-0.dll,api-ms-win-crt-stdio-l1-1-0.dll,api-ms-win-crt-string-l1-1-0.dll,api-ms-win-crt-time-l1-1-0.dll,api-ms-win-crt-utility-l1-1-0.dll,apisetschema.dll,apphelp.dll,appidapi.dll,appidsvc.dll,appinfo.dll,appmgmts.dll,appmgr.dll,appwiz.cpl,asferror.dll,asycfilt.dll,atl.dll,atmlib.dll,audiosrv.dll,auditcse.dll,auditpolmsg.dll,authfwcfg.dll,authui.dll,authz.dll,avicap32.dll,avifil32.dll,avrt.dll,azroles.dll,azroleui.dll,basecsp.dll,basesrv.dll,batmeter.dll,bcdprov.dll,bcdsrv.dll,bcrypt.dll,bcryptprimitives.dll,bdaplgin.ax,bidispl.dll,bitsigd.dll,bitsperf.dll,bootstr.dll,bopomofo.uce,bridgeres.dll,browcli.dll,browseui.dll,bthci.dll,bthpanapi.dll,bthprops.cpl,bthserv.dll,btpanui.dll,cabinet.dll,cabview.dll,capiprovider.dll,capisp.dll,catsrv.dll,catsrvps.dll,catsrvut.dll,cca.dll,cdd.dll,cdosys.dll,certCredProvider.dll,certcli.dll,certenc.dll,certmgr.dll,certprop.dll,cewmdm.dll,cfgbkend.dll,cfgmgr32.dll,ci.dll,cic.dll,clbcatq.dll,clfsw32.dll,cliconfg.dll,cliconfg.rll,clusapi.dll,cmcfg32.dll,cmdial32.dll,cmifw.dll,cmlua.dll,cmpbk32.dll,cmstplua.dll,cmutil.dll,cngprovider.dll,cnvfat.dll,cofiredm.dll,colbact.dll,colorui.dll,comcat.dll,comctl32.dll,comdlg32.dll,compstui.dll,comrepl.dll,comres.dll,comsnap.dll,comsvcs.dll,comuid.dll,concrt140.dll,connect.dll,console.dll,correngine.dll,credssp.dll,credui.dll,crypt32.dll,cryptbase.dll,cryptdlg.dll,cryptdll.dll,cryptext.dll,cryptnet.dll,cryptsp.dll,cryptsvc.dll,cryptui.dll,cryptxml.dll,cscapi.dll,cscdll.dll,cscobj.dll,cscsvc.dll,cscui.dll,csrsrv.dll,d2d1.dll,d3d10.dll,d3d10_1.dll,d3d10_1core.dll,d3d10core.dll,d3d10level9.dll,d3d10warp.dll,d3d11.dll,d3d8thk.dll,d3d9.dll,dataclen.dll,davclnt.dll,davhlpr.dll,dbgeng.dll,dbghelp.dll,dbnetlib.dll,dbnmpntw.dll,dciman32.dll,ddraw.dll,ddrawex.dll,defragproxy.dll,defragsvc.dll,desk.cpl,deskadp.dll,deskmon.dll,devenum.dll,devmgr.dll,devobj.dll,devrtl.dll,dfdts.dll,dfscli.dll,dfshim.dll,dhcpcmonitor.dll,dhcpcore.dll,dhcpcore6.dll,dhcpcsvc.dll,dhcpcsvc6.dll,dhcpsapi.dll,diagperf.dll,difxapi.dll,dimsjob.dll,dimsroam.dll,dinput.dll,dinput8.dll,dispex.dll,dmdlgs.dll,dmdskmgr.dll,dmdskres.dll,dmdskres2.dll,dmintf.dll,dmloader.dll,dmocx.dll,dmsynth.dll,dmusic.dll,dmutil.dll,dmvdsitf.dll,dnsapi.dll,dnscmmc.dll,dnsext.dll,dnshc.dll,dnsrslvr.dll,docprop.dll,dot3api.dll,dot3cfg.dll,dot3dlg.dll,dot3gpclnt.dll,dot3gpui.dll,dot3hc.dll,dot3msm.dll,dot3svc.dll,dot3ui.dll,dpapiprovider.dll,dpnaddr.dll,dpnathlp.dll,dpnet.dll,dpnhpast.dll,dpnhupnp.dll,dpnlobby.dll,dps.dll,dpx.dll,drprov.dll,drt.dll,drtprov.dll,drttransport.dll,drvstore.dll,dsauth.dll,dsdmo.dll,dskquota.dll,dskquoui.dll,dsound.dll,dsprop.dll,dsquery.dll,dsrole.dll,dssec.dat,dssec.dll,dssenh.dll,dsuiext.dll,dswave.dll,dtsh.dll,dui70.dll,duser.dll,dwmapi.dll,dwmcore.dll,dwmredir.dll,dxdiagn.dll,dxgi.dll,dxpps.dll,dxtmsft.dll,dxtrans.dll,dxva2.dll,eapp3hst.dll,eappcfg.dll,eappgnui.dll,eapphost.dll,eappprxy.dll,eapsvc.dll,efsadu.dll,efscore.dll,efslsaext.dll,efssvc.dll,efsutil.dll,els.dll,elshyph.dll,encapi.dll,energy.dll,eqossnap.dll,es.dll,esent.dll,esentprf.dll,eventcls.dll,evr.dll,fdBth.dll,fdBthProxy.dll,fdPHost.dll,fdPnp.dll,fdProxy.dll,fdSSDP.dll,fdWCN.dll,fdWNet.dll,fdWSD.dll,fde.dll,fdeploy.dll,fdprint.dll,feclient.dll,filemgmt.dll,findnetprinters.dll,fltLib.dll,fmifs.dll,fms.dll,fontext.dll,fontsub.dll,fphc.dll,framedyn.dll,framedynos.dll,fundisc.dll,fwcfg.dll,g711codc.ax,gameux.dll,gatherNetworkInfo.vbs,gb2312.uce,gcdef.dll,gdi32.dll,generaltel.dll,getuname.dll,glmf32.dll,glu32.dll,gpapi.dll,gpedit.dll,gpprefcl.dll,gpprnext.dll,gpscript.dll,gpsvc.dll,gptext.dll,hal.dll,hbaapi.dll,hdwwiz.cpl,hgcpl.dll,hhsetup.dll,hid.dll,hidphone.tsp,hidserv.dll,hlink.dll,hnetcfg.dll,hnetmon.dll,hotplug.dll,html.iec,httpapi.dll,htui.dll,ias.dll,iasacct.dll,iasads.dll,iasdatastore.dll,iashlpr.dll,iasnap.dll,iaspolcy.dll,iasrad.dll,iasrecst.dll,iassam.dll,iassdo.dll,iassvcs.dll,icfupgd.dll,icm32.dll,icmp.dll,icmui.dll,icsigd.dll,ideograf.uce,ieapfltr.dll,iedkcs32.dll,ieframe.dll,iepeers.dll,iernonce.dll,iertutil.dll,iesetup.dll,iesysprep.dll,ieui.dll,ieuinit.inf,ifmon.dll,ifsutil.dll,ifsutilx.dll,igdDiag.dll,imaadp32.acm,imagehlp.dll,imageres.dll,imagesp1.dll,imapi.dll,imapi2.dll,imapi2fs.dll,imgutil.dll,imm32.dll,inetcomm.dll,inetcpl.cpl,inetmib1.dll,inetpp.dll,inetppui.dll,input.dll,inseng.dll,intl.cpl,iologmsg.dll,iphlpsvc.dll,ipnathlp.dll,iprtprio.dll,iprtrmgr.dll,ipsecsnp.dll,ipsmsnap.dll,irprops.cpl,iscsicpl.dll,iscsidsc.dll,iscsied.dll,iscsiexe.dll,iscsilog.dll,iscsium.dll,iscsiwmi.dll,itircl.dll,itss.dll,iyuv_32.dll,joy.cpl,jscript.dll,jscript9.dll,jscript9diag.dll,jsproxy.dll,kanji_1.uce,kanji_2.uce,kbdgeoer.dll,kbdgeoqw.dll,kdcom.dll,kdusb.dll,kerberos.dll,kernel32.dll,keyiso.dll,keymgr.dll,kmddsp.tsp,korean.uce,ksproxy.ax,kstvtune.ax,ksuser.dll,ksxbar.ax,ktmw32.dll,l2gpstore.dll,l2nacp.dll,l3codeca.acm,l3codecp.acm,l_intl.nls,lcphrase.tbl,lcptr.tbl,license.rtf,licmgr10.dll,linkinfo.dll,lltdapi.dll,lltdres.dll,lltdsvc.dll,lmhsvc.dll,loadperf.dll,locale.nls,localsec.dll,localspl.dll,localui.dll,loghours.dll,logoncli.dll,lpk.dll,lpksetupproxyserv.dll,lsasrv.dll,lsmproxy.dll,lz32.dll,main.cpl,mapi32.dll,mapistub.dll,mciavi32.dll,mcicda.dll,mciqtz32.dll,mciseq.dll,mciwave.dll,mcupdate_AuthenticAMD.dll,mcupdate_GenuineIntel.dll,mdminst.dll,mf.dll,mf3216.dll,mfAACEnc.dll,mfc140.dll,mfc140chs.dll,mfc140cht.dll,mfc140deu.dll,mfc140enu.dll,mfc140esn.dll,mfc140fra.dll,mfc140ita.dll,mfc140jpn.dll,mfc140kor.dll,mfc140rus.dll,mfc140u.dll,mfc42.dll,mfc42u.dll,mfcm140.dll,mfcm140u.dll,mfcsubs.dll,mfds.dll,mfdvdec.dll,mferror.dll,mfh264enc.dll,mfmjpegdec.dll,mfplat.dll,mfps.dll,mfreadwrite.dll,mfvdsp.dll,mgmtapi.dll,microsoft-windows-hal-events.dll,microsoft-windows-kernel-power-events.dll,microsoft-windows-kernel-processor-power-events.dll,midimap.dll,miguiresource.dll,mimefilt.dll,mlang.dat,mlang.dll,mmcbase.dll,mmcndmgr.dll,mmcshext.dll,mmres.dll,mmsys.cpl,modemui.dll,moricons.dll,mpg2splt.ax,mpr.dll,mprapi.dll,mprddm.dll,mprdim.dll,mprmsg.dll,msaatext.dll,msacm32.dll,msacm32.drv,msadp32.acm,msafd.dll,msasn1.dll,msaudite.dll,mscandui.dll,mscat32.dll,msclmd.dll,mscms.dll,mscoree.dll,mscorier.dll,mscories.dll,msctf.dll,msctfime.ime,msctfp.dll,msctfui.dll,msdadiag.dll,msdart.dll,msdatsrc.tlb,msdelta.dll,msdmo.dll,msdrm.dll,msdtcVSp1res.dll,msdtckrm.dll,msdtclog.dll,msdtcprx.dll,msdtctm.dll,msdtcuiu.dll,msfeeds.dll,msfeedsbs.dll,msftedit.dll,msg711.acm,msgsm32.acm,mshtml.dll,mshtml.tlb,mshtmled.dll,mshtmler.dll,msi.dll,msident.dll,msidle.dll,msidntld.dll,msieftp.dll,msihnd.dll,msiltcfg.dll,msimg32.dll,msimsg.dll,msimtf.dll,msisip.dll,msls31.dll,msmpeg2adec.dll,msmpeg2vdec.dll,msobjs.dll,msoert2.dll,mspatcha.dll,msports.dll,msprivs.dll,msrahc.dll,msrating.dll,msrdc.dll,msrle32.dll,msscntrs.dll,mssign32.dll,mssip32.dll,mssitlb.dll,mssph.dll,mssprxy.dll,mssrch.dll,mssvp.dll,mstask.dll,mstscax.dll,msutb.dll,msv1_0.dll,msvcirt.dll,msvcp140.dll,msvcp140_1.dll,msvcp140_2.dll,msvcp140_atomic_wait.dll,msvcp140_codecvt_ids.dll,msvcp60.dll,msvcrt.dll,msvfw32.dll,msvidc32.dll,mswmdm.dll,mswsock.dll,msxml3.dll,msxml3r.dll,msxml6.dll,msxml6r.dll,msyuv.dll,mtxclu.dll,mtxdm.dll,mtxex.dll,mtxoci.dll,muifontsetup.dll,mycomput.dll,mydocs.dll,nci.dll,ncobjapi.dll,ncpa.cpl,ncrypt.dll,ncsi.dll,nddeapi.dll,ndfapi.dll,ndfetw.dll,ndfhcdiscovery.dll,ndishc.dll,ndproxystub.dll,negoexts.dll,netapi32.dll,netbios.dll,netcenter.dll,netcfgx.dll,netcorehc.dll,netdiagfx.dll,netevent.dll,netfxperf.dll,neth.dll,netid.dll,netiohlp.dll,netjoin.dll,netlogon.dll,netman.dll,netmsg.dll,netplwiz.dll,netprofm.dll,netshell.dll,nettrace.dll,netutils.dll,networkexplorer.dll,networkitemfactory.dll,newdev.dll,nlaapi.dll,nlahc.dll,nlhtml.dll,nlmgp.dll,nlmsprep.dll,nlsbres.dll,normaliz.dll,normidna.nls,normnfc.nls,normnfd.nls,normnfkc.nls,normnfkd.nls,npmproxy.dll,nrpsrv.dll,nshhttp.dll,nshipsec.dll,nshwfp.dll,nsi.dll,nsisvc.dll,ntdll.dll,ntdsapi.dll,ntlanman.dll,ntlanui2.dll,ntmarta.dll,ntprint.dll,ntshrui.dll,ntvdm64.dll,objsel.dll,occache.dll,ocsetapi.dll,odbc32.dll,odbcbcp.dll,odbcconf.dll,odbcconf.rsp,odbccp32.dll,odbccr32.dll,odbccu32.dll,odbcint.dll,odbctrac.dll,offfilt.dll,ole32.dll,oleacc.dll,oleacchooks.dll,oleaccrc.dll,oleaut32.dll,oledlg.dll,oleprn.dll,onex.dll,onexui.dll,opengl32.dll,osbaseln.dll,osuninst.dll,p2pnetsh.dll,p2psvc.dll,packager.dll,panmap.dll,pautoenr.dll,pcadm.dll,pcaevts.dll,pcasvc.dll,pcaui.dll,pcl.sep,pcwum.dll,pcwutl.dll,pdh.dll,pdhui.dll,perfc009.dat,perfd009.dat,perfdisk.dll,perfh009.dat,perfi009.dat,perfnet.dll,perfos.dll,perfproc.dll,perfts.dll,photowiz.dll,pid.dll,pidgenx.dll,pifmgr.dll,pku2u.dll,pla.dll,pngfilt.dll,pnidui.dll,pnpts.dll,pnpui.dll,pnrpauto.dll,pnrpnsp.dll,pnrpsvc.dll,polstore.dll,pots.dll,powercfg.cpl,powercpl.dll,powrprof.dll,prfc0804.dat,prfd0804.dat,prfh0804.dat,prfi0804.dat,prflbmsg.dll,printfilterpipelineprxy.dll,printui.dll,prncache.dll,prnfldr.dll,prnntfy.dll,prntvpt.dll,profapi.dll,profprov.dll,profsvc.dll,propsys.dll,provthrd.dll,psapi.dll,pscript.sep,psisdecd.dll,psisrndr.ax,pstorec.dll,puiapi.dll,puiobj.dll,pwrshplugin.dll,qasf.dll,qcap.dll,qdv.dll,qdvd.dll,qedit.dll,qedwipes.dll,qmgr.dll,quartz.dll,qwave.dll,racpldlg.dll,radardt.dll,radarrs.dll,rasadhlp.dll,rasapi32.dll,rasauto.dll,raschap.dll,rasctrnm.h,rasctrs.dll,rasdiag.dll,rasdlg.dll,rasgcw.dll,rasman.dll,rasmans.dll,rasmbmgr.dll,rasmontr.dll,rasplap.dll,rasppp.dll,rastapi.dll,rastls.dll,rdpcfgex.dll,rdpcorets.dll,rdpendp.dll,rdpudd.dll,regapi.dll,regidle.dll,regsvc.dll,remotepg.dll,remotesp.tsp,rendezvousSession.tlb,resutils.dll,rgb9rast.dll,riched20.dll,riched32.dll,rnr20.dll,rpchttp.dll,rpcnsh.dll,rpcrt4.dll,rpcss.dll,rsaenh.dll,rshx32.dll,rtffilt.dll,rtm.dll,rtutils.dll,samcli.dll,samlib.dll,samsrv.dll,sas.dll,sbe.dll,sbeio.dll,sberes.dll,scansetting.dll,scavengeui.dll,scecli.dll,scesrv.dll,schannel.dll,schedcli.dll,schedsvc.dll,scksp.dll,scripto.dll,scrnsave.scr,scrobj.dll,scrptadm.dll,scrrun.dll,sdhcinst.dll,sdiageng.dll,sdiagprv.dll,sdiagschd.dll,sdohlp.dll,sechost.dll,seclogon.dll,secproc.dll,secproc_isv.dll,secproc_ssp.dll,secproc_ssp_isv.dll,secur32.dll,security.dll,sendmail.dll,sensrsvc.dll,serialui.dll,serwvdrv.dll,setbcdlocale.dll,setupapi.dll,setupcln.dll,setupetw.dll,sfc.dll,sfc_os.dll,shacct.dll,sharemediacpl.dll,shdocvw.dll,shell32.dll,shellstyle.dll,shfolder.dll,shgina.dll,shimeng.dll,shimgvw.dll,shlwapi.dll,shpafact.dll,shsetup.dll,shsvcs.dll,shunimpl.dll,shwebsvc.dll,signdrv.dll,simpdata.tlb,slc.dll,slcext.dll,slmgr.vbs,slwga.dll,snmpapi.dll,softkbd.dll,softpub.dll,spbcd.dll,spfileq.dll,spnet.dll,spoolss.dll,spopk.dll,sppc.dll,sppcext.dll,sppcomapi.dll,sppcommdlg.dll,sppnp.dll,sppobjs.dll,sppwinob.dll,sppwmi.dll,spwizeng.dll,spwizimg.dll,spwizres.dll,sqlsrv32.dll,sqlsrv32.rll,sqmapi.dll,srchadmin.dll,srvcli.dll,srvsvc.dll,sscore.dll,ssdpapi.dll,ssdpsrv.dll,sspicli.dll,sspisrv.dll,sstpsvc.dll,stclient.dll,stdole2.tlb,stdole32.tlb,sti.dll,sti_ci.dll,stobject.dll,streamci.dll,sud.dll,swprv.dll,sxs.dll,sxshared.dll,sxssrv.dll,sxsstore.dll,sysclass.dll,sysdm.cpl,sysmain.dll,sysntfy.dll,sysprint.sep,sysprtj.sep,syssetup.dll,systemcpl.dll,t2embed.dll,tapi3.dll,tapi32.dll,tapilua.dll,tapiperf.dll,tapisrv.dll,tapiui.dll,taskbarcpl.dll,taskcomp.dll,taskschd.dll,tbs.dll,tcpipcfg.dll,tcpmib.dll,tcpmon.dll,tcpmon.ini,tcpmonui.dll,tdh.dll,telephon.cpl,termmgr.dll,termsrv.dll,themecpl.dll,themeservice.dll,themeui.dll,thumbcache.dll,timedate.cpl,tlscsp.dll,tpmcompc.dll,tquery.dll,traffic.dll,trkwks.dll,tsbyuv.dll,tscfgwmi.dll,tsgqec.dll,tsmf.dll,tspubwmi.dll,tssrvlic.dll,tvratings.dll,txflog.dll,txfw32.dll,tzres.dll,uDWM.dll,ubpm.dll,ucmhc.dll,ucrtbase.dll,udhisapi.dll,uexfat.dll,ufat.dll,uicom.dll,ulib.dll,umb.dll,umdmxfrm.dll,umpnpmgr.dll,umpo.dll,umrdp.dll,unattend.dll,unimdm.tsp,unimdmat.dll,uniplat.dll,untfs.dll,upnp.dll,upnphost.dll,ureg.dll,url.dll,urlmon.dll,usbmon.dll,usbperf.dll,usbui.dll,user32.dll,usercpl.dll,userenv.dll,usp10.dll,utildll.dll,uudf.dll,uxlib.dll,uxlibres.dll,uxtheme.dll,vaultcli.dll,vaultsvc.dll,vbisurf.ax,vbscript.dll,vcamp140.dll,vccorlib140.dll,vcomp140.dll,vcruntime140.dll,vcruntime140_1.dll,vds_ps.dll,vdsbas.dll,vdsdyn.dll,vdsutil.dll,vdsvd.dll,verifier.dll,version.dll,vfwwdm32.dll,vidcap.ax,virtdisk.dll,vmbuspipe.dll,vmictimeprovider.dll,ike.dll,ikeapi.dll,vsocklib.dll,vss_ps.dll,vssapi.dll,vsstrace.dll,w32time.dll,w32topl.dll,wavemsp.dll,wbemcomn.dll,wcncsvc.dll,wcnwiz.dll,wdc.dll,wdi.dll,wdigest.dll,wdmaud.drv,wdscore.dll,webcheck.dll,webio.dll,webservices.dll,wecapi.dll,wecsvc.dll,wer.dll,werconcpl.dll,werdiagcontroller.dll,wevtapi.dll,wevtfwd.dll,wevtsvc.dll,wfapigp.dll,whealogr.dll,whhelper.dll,wiaaut.dll,wiadefui.dll,wiadss.dll,wiarpc.dll,wiascanprofiles.dll,wiaservc.dll,wiashext.dll,wiatrace.dll,wimgapi.dll,win32k.sys,win32spl.dll,winbrand.dll,wincredprovider.dll,winethc.dll,winhttp.dll,wininet.dll,winipsec.dll,winload.efi,winmm.dll,winnsi.dll,winresume.efi,winrm.cmd,winrm.vbs,winrnr.dll,winrscmd.dll,winrsmgr.dll,winrssrv.dll,winshfhc.dll,winsockhc.dll,winspool.drv,winsrv.dll,winsta.dll,wintrust.dll,winusb.dll,wkscli.dll,wksprtPS.dll,wkssvc.dll,wlanapi.dll,wlancfg.dll,wlandlg.dll,wlangpui.dll,wlanhlp.dll,wlanmsm.dll,wlanpref.dll,wlansec.dll,wlansvc.dll,wlanui.dll,wlanutil.dll,wlgpclnt.dll,wmcodecdspps.dll,wmdmlog.dll,wmdmps.dll,wmdrmsdk.dll,wmi.dll,wmidx.dll,wmiprop.dll,wmsgapi.dll,wmvdspa.dll,wow64.dll,wow64cpu.dll,wow64win.dll,wpd_ci.dll,wpdbusenum.dll,wpdshext.dll,ws2_32.dll,ws2help.dll,wsdchngr.dll,wsecedit.dll,wsepno.dll,wshbth.dll,wshcon.dll,wshelper.dll,wshext.dll,wship6.dll,wshqos.dll,wshrm.dll,wsmplpxy.dll,wsnmp32.dll,wsock32.dll,wtsapi32.dll,wuapi.dll,wuaueng.dll,wudriver.dll,wups.dll,wups2.dll,wvc.dll,wwancfg.dll,wwanprotdim.dll,wwansvc.dll,wwapi.dll,xmlfilter.dll,xmllite.dll,xmlprovi.dll,xolehlp.dll,xpsservices.dll,xwizard.dtd,xwizards.dll,xwreg.dll,xwtpdui.dll,xwtpw32.dll,zipfldr.dll"
    dll_all_name_slice := strings.Split(dll_all_name, ",")
    for _, file := range dll_all_name_slice {
        if !IsExit(file) {
            //https://你的oss地址/fixsys/win7/AUDIOKSE.dll
            //下载网上文件到指定目录
            isNeedReboot = 1
            url := "https://你的oss地址/fixsys/win7/" + file
            filepath1 := "C:/Windows/System32" + "/" + file
            downFileToSysDir(url, filepath1)
            fmt.Println(file + "已经修复成功,我真的恭喜您,您离成功更近了")
        }

    }
    time.Sleep(1 * time.Second)
    println("dll已经修复完成")
    time.Sleep(1 * time.Second)
    println("可以关闭此窗口了,dll已经修复完成,切记需要重启电脑,电脑重启后,软件就可以使用了!")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    time.Sleep(1 * time.Second)
    println("切记需要重启电脑")
    if isNeedReboot == 1 {
        println("即将重启您的电脑。。。。。")
        time.Sleep(2 * time.Second)
        println("即将重启您的电脑。。。。。")
        time.Sleep(2 * time.Second)
        println("正在进行重启")
        time.Sleep(1 * time.Second)
        ReShutDownEXE()

    }
    time.Sleep(20 * time.Minute)

    /*
        var files []string
        var files_conf []string

        err1 := filepath.Walk(dllPath, func(path string, info os.FileInfo, err error) error {
            files = append(files, path)
            return nil
        })
        if err1 != nil {
            panic(err)
        }
        for _, file := range files {

            temp_slice := strings.Split(file, "\\")

            file_conf := temp_slice[len(temp_slice)-1]

            if !(strings.Contains(file_conf, "fixsys") || strings.Contains(file_conf, "win7")) {
                files_conf = append(files_conf, file_conf)
            }

        }
        var dll_all_str = ""
        for _, file := range files_conf {
            if len(file) > 0 {
                dll_all_str = dll_all_str + file + ","
            }

        }
        fmt.Println(dll_all_str)
    */

}

总结

开发各种可视化计划任务,开发各种采集模型,让数据服务于全人类,欢迎私聊。

你可能感兴趣的:(golang,系统安全,windows)