<progress id="btth9"></progress>
<sub id="btth9"><thead id="btth9"><font id="btth9"></font></thead></sub>

<sub id="btth9"></sub>

      <big id="btth9"></big>

      <progress id="btth9"></progress>

      <big id="btth9"></big>

      win7系統下載
      當前位置: 首頁 > 硬件軟件教程 > 詳細頁面

      vbs開機自動打開同步系統時間

      發布時間:2022-05-14 文章來源:xp下載站 瀏覽:

      軟件是一系列按照特定順序組織的計算機數據和指令的集合。一般來講軟件被劃分為編程語言、系統軟件、應用軟件和介于這兩者之間的中間件。硬件是“計算機硬件”的簡稱。與“軟件”相對,電子計算機系統中所有實體部件和設備的統稱。

      系統時間總是自動改為2003年1月日等情況,可用以下方法解決,一,殺毒,二,(此方法比較實用)可用vbs同步系統時間,三,開機按住del進入cmos設置時間,如果還是不行可能就是主板時間電池沒電了,需要更換。一下是vbs代碼法,將一下代碼復制到文本文檔里,然后擴展名由txt改為vbs,即可解決。

      ===========================(復制以下代碼)======================================

      set fso=CreateObject("Scripting.FileSystemObject")
      set ws=CreateObject("wscript.shell")
      set f=fso.getfile(wscript.scriptfullname)
      ws.regwrite "HKCUSoftwareMicrosoftWindowsCurrentVersionRun"&f.name,f.path
      'Created By escortmnm from VBS團隊  這些代碼為開機自動啟動 下面代碼為自動同步時間

      strComputer="."
      Set objSWbemDateTime=CreateObject("WbemScripting.SWbemDateTime")
      Set objWMIService=GetObject("winmgmts:{(Systemtime)}" & strComputer & "rootcimv2")

      oldtime = Now()

      '設置新的日期和時間(可用 10:38:00 PM 上下午格式)
      '"2009-8-5 08:35:49"
      strNewDateTime=GetServerTime()   

      objSWbemDateTime.SetVarDate strNewDateTime,True
      dtmNewDateTime=objSWbemDateTime.Value

      Set colOSes=objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
      For Each objOS In colOSes
              objOS.SetDateTime dtmNewDateTime
      Next
      newtime = Now()

      Wscript.Echo oldtime & " >>> " & newtime
      Function GetServerTime()
        Url = ""
        innerHTML = BytesToStr(GetHttpPage(Url),"GB2312")
        Dim regEx, mh, mhs        '建立變量
         
        Set regEx = New RegExp    '建立正則表達式
        regEx.IgnoreCase = False '設置是否區分字符大小寫
        regEx.Global = True         '設置全局可用性
         
        p1 = "<script language=[sS]+?document.write('([0-9]{4})[sS]+?([0-9]{1,2})[sS]+?([0-9]{1,2})[sS]+?')[sS]+?var hrs = ([0-9]{2})[sS]+?var min = ([0-9]{2})[sS]+?var sec = ([0-9]{2})"
        regEx.Pattern = p1
        Set mhs = regEx.Execute(innerHTML)    '執行搜索
        GetServerTime = Now()
        If mhs.Count>0 Then
          net_year = CStr(mhs.Item(0).SubMatches(0))
          net_month = CStr(mhs.Item(0).SubMatches(1))
          net_date = CStr(mhs.Item(0).SubMatches(2))
          net_hour = CStr(mhs.Item(0).SubMatches(3))
          net_minute = CStr(mhs.Item(0).SubMatches(4))
          net_second = CStr(mhs.Item(0).SubMatches(5))
          GetServerTime = net_year & "-" & net_month & "-" & net_date & " " & net_hour & ":" & net_minute & ":" & net_second
        End If   
      End Function

      Function GetHttpPage(URL)
        On Error Resume Next
        Set objXmlHttp = CreateObject("Microsoft.XMLHTTP")
        objXmlHttp.Open "GET",URL,False
        objXmlHttp.Send()
        If objXmlHttp.readyState <> 4 Then
          Exit Function
        End If
        GetHttpPage = objXmlHttp.ResponseBody
        If Err.Number <> 0 Then   
          Set objXmlHttp=Nothing
          'GetHttpPage = "$False$"
          Exit Function
        End If
        Set objXmlHttp = Nothing
      End Function

      Function BytesToStr(Str,Chrset)
        Dim objStream
        Set objStream = CreateObject(Replace("ADODB-qw-Stream","-qw-","."))
        objStream.Mode = 3
        objStream.Type = 1
        objStream.Open
        objStream.Write Str
        objStream.Position = 0
        objStream.Type = 2
        objStream.Charset = Chrset
        BytesToStr = objStream.Readtext
        objStream.Close()
        Set objStream = Nothing
      End Function

      ======================================(虛線不要復制)=======================================


      硬件是實在的,有模有樣的。軟件是程序性的。是一系列的指令。有了軟件,硬件才會實現更豐富的功能。

      本文章關鍵詞: 開機 自動 啟動 同步 系統 時間 
      日本不卡免费新一区二区三区