troubleshooting Question

Setting Windows Time and Date

Avatar of arunykand
arunykandFlag for United States of America asked on
Windows XPC#Internet ProtocolsWindows 7
11 Comments1 Solution622 ViewsLast Modified:
Experts,
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!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros