[ÐÂÊÖÉÏ·]Åú´¦ÀíÐÂÊÖÈëÃŵ¼¶Á[ÊÓƵ½Ì³Ì]Åú´¦Àí»ù´¡ÊÓƵ½Ì³Ì[ÊÓƵ½Ì³Ì]VBS»ù´¡ÊÓƵ½Ì³Ì[Åú´¦Àí¾«Æ·]Åú´¦Àí°æÕÕƬÕûÀíÆ÷
[Åú´¦Àí¾«Æ·]´¿Åú´¦Àí±¸·Ý&»¹Ô­Çý¶¯[Åú´¦Àí¾«Æ·]CMDÃüÁî50Ìõ²»ÄÜ˵µÄÃØÃÜ[ÔÚÏßÏÂÔØ]µÚÈý·½ÃüÁîÐй¤¾ß[ÔÚÏß°ïÖú]VBScript / JScript ÔÚÏ߲ο¼
·µ»ØÁÐ±í ·¢Ìû
½¨Òé¼ÓÈë UNC ÔËÐÐÌáÐÑ¡£

JS°æ
  1. <title>
  2.     EasyX v20120603(beta) °²×°Ïòµ¼
  3. </title>
  4. <script type="text/javascript">
  5.     function GetSystemVersion() {
  6.         var os = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem");
  7.         for (var e = new Enumerator(os); ! e.atEnd(); e.moveNext()) {
  8.             var v = e.item().Version;
  9.             var ss = v.split('.');
  10.             return ss[0] + ss[1];
  11.         }
  12.         return - 1;
  13.     }
  14.     if (GetSystemVersion() >= 60) {
  15.         var cmd = location.pathname;
  16.         if (cmd.substring(cmd.length - 4) != ".HTA") {
  17.             var Shell = new ActiveXObject("Shell.Application");
  18.             Shell.ShellExecute("mshta.exe", "\"" + cmd.substring(0, cmd.length - 4) + ".HTA\"", "", "runas", 1);
  19.             window.close();
  20.             exit(0);
  21.         }
  22.     }
  23. </script>
¸´ÖÆ´úÂë
¡ºÇ§½­ÓÐˮǧ½­Ô¡»Ç§½­ÓÐË®£¬ÔÂӳǧ½­£»ÍòÀïÎÞÔÆ£¬ÍòÀïÇàÌì¡£    http://yu2n.qiniudn.com/

TOP

±¾Ìû×îºóÓÉ yu2n ÓÚ 2019-5-26 12:41 ±à¼­

2019.05.26  ÒѸüÐÂʱ¼äÀ´Ô´£¬¿ÉÉèÖÃÈÎÒâÍøվΪʱ¼äÔ´¡£ (×Ô¶¨Òå HTTP ·þÎñÆ÷¿ÉÐ޸ĴúÂëÖÐµÄ http://www.microsoft.com )

Win7x64 / Win10x64 ²âÊÔͨ¹ý
  1. 'VBSУ׼ϵͳʱ¼ä BY Yu2n  2019.05.26
  2. Option Explicit
  3. RunAsAdminX64
  4. Main
  5. '************************************************************************
  6. Sub Main()
  7. '************************************************************************
  8. Dim dtNet, dtLocal1, dtLocal2, lngOffset1, lngOffset2, strMessage
  9. dtNet = GetNetTime("http://www.microsoft.com")
  10. dtLocal1 = Now()
  11. lngOffset1 = Abs(DateDiff("s", dtNet, dtLocal1))
  12. If lngOffset1 > 1 Then
  13. SetDateTime dtNet
  14. dtLocal2 = Now()
  15. lngOffset2 = Abs(DateDiff("s", dtNet, dtLocal2))
  16. strMessage = "¡¾Ð£×¼Ç°¡¿" & vbCrLf _
  17. & "±ê×¼±±¾©Ê±¼äΪ£º" & vbTab & dtNet & vbCrLf _
  18. & "±¾»úϵͳʱ¼äΪ£º" & vbTab & dtLocal1 & vbCrLf _
  19. & "Óë±ê׼ʱ¼äÏà²î£º" & vbTab & lngOffset1 & "Ãë" & vbCrLf & vbCrLf _
  20. & "¡¾Ð£×¼ºó¡¿" & vbCrLf _
  21. & "±ê×¼±±¾©Ê±¼äΪ£º" & vbTab & dtNet & vbCrLf _
  22. & "±¾»úϵͳʱ¼äΪ£º" & vbTab & dtLocal2 & vbCrLf _
  23. & "Óë±ê׼ʱ¼äÏà²î£º" & vbTab & lngOffset2 & "Ãë"
  24. Else
  25. strMessage =  "¡¾ÎÞÐèУ׼¡¿" & vbCrLf _
  26. & "±ê×¼±±¾©Ê±¼äΪ£º" & vbTab & dtNet & vbCrLf _
  27. & "±¾»úϵͳʱ¼äΪ£º" & vbTab & dtLocal1 & vbCrLf _
  28. & "Óë±ê׼ʱ¼äÏà²î£º" & vbTab & lngOffset1 & "Ãë"
  29. End If
  30. WScript.Echo strMessage
  31. End Sub
  32. '************************************************************************
  33. '»ñÈ¡ÍøÂçÉÏÖ¸¶¨µÄHTTP·þÎñÆ÷ʱ¼ä
  34. '************************************************************************
  35. Function GetNetTime(ByVal Url)
  36.     Dim Bias, DateLine 'ʱ¼äÆ«ÒÆ£¨·ÖÖÓ£©
  37.     Dim dtGMT, dtLocal, dtBegin
  38. On Error Resume Next
  39.     With CreateObject("WScript.Shell")
  40. '[ActiveTimeBias]:¸Ã¼üÖµ´æ´¢µ±Ç°ÏµÍ³Ê±¼äÏà¶Ô¸ñÁÖÄáÖαê׼ʱ¼äµÄÆ«ÒÆ£¨ÒÔ·ÖÖÓΪµ¥Î»£©
  41. '[Bias]:¸Ã¼üÖµ´æ´¢µ±Ç°±¾µØʱ¼äÏà¶Ô¸ñÁÖÄáÖαê׼ʱ¼äµÄÆ«ÒÆ£¨ÒÔ·ÖÖÓΪµ¥Î»£©
  42. Bias = .RegRead("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
  43.     End With
  44.     With CreateObject("Microsoft.XMLHTTP")
  45. dtBegin = Now()
  46.     .Open "POST", Url, False
  47.     .Send
  48. If Err.Number = 0 Then
  49. dtGMT = Split(Replace(.getResponseHeader("Date"), " GMT", ""), ",")(1)
  50. If IsDate(dtGMT) Then
  51. dtLocal = DateAdd("n", -CLng(Bias), CDate(dtGMT)) '±±¾©Ê±¼ä£ºGMT+8
  52. dtLocal = DateAdd("s", DateDiff("s", dtBegin, Now()), dtLocal) 'ʱ¼äËðºÄ
  53. GetNetTime = dtLocal
  54. End If
  55. End If
  56.     End With
  57. End Function
  58. '************************************************************************
  59. 'É趨µçÄÔµÄʱ¼ä
  60. '************************************************************************
  61. Function SetDateTime(ByVal dt1)
  62. Dim WmiService, ComputerName, OSList, OSEnum, OS, DateTime
  63. ComputerName = "."
  64. Set WmiService = GetObject("winmgmts:{impersonationLevel=impersonate, (Systemtime)}!//" + ComputerName + "/root/cimv2")
  65. Set OSList = WmiService.InstancesOf ("Win32_OperatingSystem")
  66. Set DateTime = CreateObject("WbemScripting.SWbemDateTime")
  67. For Each OSEnum In OSList
  68. DateTime.Value = OSEnum.LocalDateTime
  69. DateTime.Year = Year(dt1)
  70. DateTime.Month = Month(dt1)
  71. DateTime.Day = Day(dt1)
  72. DateTime.Hours = Hour(dt1)
  73. DateTime.Minutes = Minute(dt1)
  74. DateTime.Seconds = Second(dt1)
  75. If (OSEnum.SetDateTime(DateTime.Value) <> 0) Then
  76. 'WScript.Echo "¾¯¸æ£ºÉèÖÃϵͳʱ¼äʧ°Ü£¡"
  77. SetDateTime = False
  78. Else
  79. 'WScript.Echo "Ìáʾ£ºÉèÖóɹ¦¡£µ±Ç°Ê±¼ä£º" & DateTime.GetVarDate()
  80. SetDateTime = True
  81. End If
  82. Next
  83. End Function
  84. '************************************************************************
  85. '³õʼ»¯ RunAsAdminX64 For Win10 x64
  86. '************************************************************************
  87. Function RunAsAdminX64()
  88. Dim wso, fso, dwx, sSFN, sSD32, sSF32, vArg, sArgs, oShell, sDWX
  89. Set wso = CreateObject("WScript.Shell")
  90. Set fso = CreateObject("Scripting.filesystemobject")
  91. RunAsAdminX64 = False
  92. '»ñÈ¡ WSH ²ÎÊý
  93. For Each vArg In WScript.Arguments
  94. sArgs = sArgs & " " & """" & vArg & """"
  95. Next
  96. '»ñÈ¡ 32 λ WSH Ŀ¼
  97. sSFN = fso.GetFile(WScript.FullName).Name
  98. sSD32 = wso.ExpandenVironmentStrings("%windir%\SysWOW64")
  99. If Not fso.FileExists(sSD32 & "\" & sSFN ) Then
  100. sSD32 = wso.ExpandenVironmentStrings("%windir%\System32")
  101. End If
  102. 'ÒÔ 32 λ WSH ÔËÐÐ
  103. If UCase(WScript.FullName) <> UCase(sSD32 & "\" & sSFN) Then
  104. wso.Run sSD32 & "\" & sSFN & " """ & WScript.ScriptFullName & """" & sArgs, 1, False
  105. WScript.Quit
  106. End If
  107. 'ÒÔ¹ÜÀíԱȨÏÞÔËÐÐ WSH
  108. If Not WScript.Arguments.Named.Exists("ADMIN") Then
  109. Set oShell = CreateObject("Shell.Application")
  110. oShell.ShellExecute WScript.FullName, """" & WScript.ScriptFullName & """ " & sArgs & " /ADMIN:1 ", "", "runas", 6
  111. WScript.Quit
  112. End If
  113. End Function
¸´ÖÆ´úÂë
¡ºÇ§½­ÓÐˮǧ½­Ô¡»Ç§½­ÓÐË®£¬ÔÂӳǧ½­£»ÍòÀïÎÞÔÆ£¬ÍòÀïÇàÌì¡£    http://yu2n.qiniudn.com/

TOP

±¾Ìû×îºóÓÉ yu2n ÓÚ 2019-5-26 12:41 ±à¼­

2019.05.26  ÒѸüÐÂʱ¼äÀ´Ô´£¬¿ÉÉèÖÃÈÎÒâÍøվΪʱ¼äÔ´¡£ (×Ô¶¨Òå HTTP ·þÎñÆ÷¿ÉÐ޸ĴúÂëÖÐµÄ http://www.microsoft.com )

Js Ò²À´´ÕÈÈÄÖÁË¡­¡­
  1. //ÎļþÃû³Æ£ºSyncNetTime2.js
  2. //¹¦ÄÜ˵Ã÷£ºÍ¬²½±¾»úʱ¼äÓëÍøÂçʱ¼ä
  3. //ʹÓ÷½·¨£ºCscript.exe //nologo SyncNetTime.js
  4. //²âÊÔ»·¾³£ºÏµÍ³ Win10 x64 ʱ¼ä 18/1/15 Óû§ Yu2n
  5. //¸üÐÂÄÚÈÝ£ºFix »ñÈ¡ÍøÂçʱ¼ä£¬´Ó HTTP SERVER HEADER
  6. //ÒÔ¹ÜÀíÔ±ÔËÐÐ
  7. function GetSystemVersion() {
  8. var os = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem");
  9. for (var e = new Enumerator(os); ! e.atEnd(); e.moveNext()) {
  10. var v = e.item().Version;
  11. var ss = v.split('.');
  12. return ss[0] + ss[1];
  13. }
  14. return - 1;
  15. }
  16. if (GetSystemVersion() >= 60) {
  17. var cmd = WScript.ScriptFullName;
  18. if (cmd.substring(cmd.length - 3) != ".jS") {
  19. var Shell = new ActiveXObject("Shell.Application");
  20. Shell.ShellExecute("wscript.exe", "\"" + cmd.substring(0, cmd.length - 3) + ".jS\"", "", "runas", 1);
  21. WScript.Quit(0);
  22. }
  23. }
  24. //»ñÈ¡ÍøÂçʱ¼ä£¬´Ó HTTP SERVER HEADER
  25. var getNetDate = function() {
  26. var dtGMT = '';
  27. try{
  28. var http = new ActiveXObject("Microsoft.XMLHTTP");
  29. http.open("POST", "http://www.microsoft.com?rnd=" + (new Date()), false);
  30. http.send();
  31. dtGMT = http.getResponseHeader("Date");
  32. if (dtGMT != '') {
  33. return new Date(dtGMT);
  34. } else {
  35. WScript.Echo("¾¯¸æ£º»ñÈ¡ÍøÂçʱ¼äʧ°Ü£¡")
  36. WScript.Quit(0);
  37. };
  38. }catch(e){};
  39. };
  40. //ÉèÖÃʱ¼ä
  41. function ChangeDate()
  42. {
  43. var WmiService, ComputerName, OSList, OSEnum, OS, DateTime;
  44. ComputerName = ".";
  45. WmiService = GetObject ("winmgmts:{impersonationLevel=impersonate, (Systemtime)}!//" + ComputerName + "/root/cimv2");
  46. OSList = WmiService.InstancesOf ("Win32_OperatingSystem");
  47. DateTime = new ActiveXObject ("WbemScripting.SWbemDateTime");
  48. OSEnum = new Enumerator (OSList);
  49. for ( ; !OSEnum.atEnd(); OSEnum.moveNext())
  50. {
  51. OS = OSEnum.item();
  52. var dtNewDate = getNetDate(); //»ñÈ¡ÍøÂçʱ¼ä
  53. DateTime.Value = OS.LocalDateTime;
  54. DateTime.Year = dtNewDate.getFullYear();
  55. DateTime.Month = dtNewDate.getMonth() + 1;
  56. DateTime.Day = dtNewDate.getDate();
  57. DateTime.Hours = dtNewDate.getHours();
  58. DateTime.Minutes = dtNewDate.getMinutes();
  59. DateTime.Seconds = dtNewDate.getSeconds();
  60. if (OS.SetDateTime(DateTime.Value) != 0) {
  61. WScript.Echo("¾¯¸æ£ºÉèÖÃϵͳʱ¼äʧ°Ü£¡");
  62. } else {
  63. WScript.Echo("Ìáʾ£ºÉèÖóɹ¦¡£µ±Ç°Ê±¼ä£º" + new Date(DateTime.GetVarDate()).toLocaleString());
  64. };
  65. }
  66. }
  67. ChangeDate();
  68. WScript.Quit(0);
¸´ÖÆ´úÂë
¡ºÇ§½­ÓÐˮǧ½­Ô¡»Ç§½­ÓÐË®£¬ÔÂӳǧ½­£»ÍòÀïÎÞÔÆ£¬ÍòÀïÇàÌì¡£    http://yu2n.qiniudn.com/

TOP

»Ø¸´ 13# citygun


    ÒѸüÐÂʱ¼äÀ´Ô´£¬¿ÉÉèÖÃÈÎÒâÍøվΪʱ¼äÔ´¡£
¡ºÇ§½­ÓÐˮǧ½­Ô¡»Ç§½­ÓÐË®£¬ÔÂӳǧ½­£»ÍòÀïÎÞÔÆ£¬ÍòÀïÇàÌì¡£    http://yu2n.qiniudn.com/

TOP

·µ»ØÁбí