Python synchronizes windows Time and python synchronizes windows Time.

Source: Internet
Author: User
Tags net time

Python synchronizes windows Time and python synchronizes windows Time.

Import OS
Com1 = 'net use \\\\ 192.168.0.90 \ ipc $ PPss01! 123/user: administrator'
OS. system (com1)
Com2 = 'net time \\\\ 192.168.0.90/set/yes'
OS. system (com2)
Com3 = 'pause'
OS. system (com3)

 

 

 


How to Implement server Time Synchronization Through NTP protocol in Windows (python or C)

(You know you cannot send a link .)
1. Obtain the NTP server time. Locate ntplib in pypi. There are examples.
2. Set the windows system time. There are many methods. You can use the date command directly. You can also use the win32API SetSystemTime, which has better precision control and can be set to ms.

If you want to periodically schedule tasks, set the scheduled tasks.

Windows System Time Synchronization

You open the windows time and date Properties dialog box

There is time synchronization with the INTERNET, and then enter your server address!
You can implement automatic update pull.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.