I have two computers one running WinXP (Machine-A), which is a stand-alone (no keyboard/mouse, but has a 8 button joystick & monitor) and another is a laptop running Win7 (Machine-B).
Typical execution is, WinXP boots up and runs a custom software and when required, the Win7 laptop connects to the WinXP machine via cross over cable and access a network share to download some files to the laptop.
The issue we are running into is, the CMOS battery on the WinXP machine is dying and reverting the system time to some date in 2011. With this issue present, when the Win7 machine tries to access the fileshare on the XP machine, it fails. For the longest time, I used to think this was a username/password issue, but it is directly related to the time difference between the two machines (If we manually make one match the other, the file share works like a charm).
So now onto my question: I can see two options for me to fix this:
1 ) try to do a 'net time' from the XP machine to get the time from the Win7 machine when it is hooked up and set it's time to the correct time. (This might not work due to security policies, I need to check)
2). Modify my software on the XP machine to enter a time/date manually (Via joystick, i'll have to figure out how to do this) and set that time for Windows.
Can you please tell me how (Again, i'll figure out how to get the user to input the time via the joystick) to take the time in 'HH:MM AM/PM' and date in 'MM/DD/YYYY' format and set it for Windows time? I am using C++, so code snippets on how to accomplish this will be very helpful. BTW, I do have psexec available on both PC's but I am not sure I can guarantee that the 'time' & 'date' commands via psexec will work 100% of the time, so that's why I figured having the user enter the time manually will be the best approach
Thanks so much!