Announcement

Collapse
No announcement yet.

Changing Windows time with PB/Doss

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing Windows time with PB/Doss

    I have been working on a calendar program. I will change both the system clock
    ans the real clock. However, windows seems to maintain it's own time variable
    and writes it back when closing down.

    Is there a way to change windows time form within a pb/dos program.

    Thanks for any reply

    Tony

    ------------------

  • #2
    Since you appear to be using the time change only for testing purposes, maybe you could insert something like...

    Code:
     TIME$ = (time you are setting for testing purposes)
     SHELL  "SetClock.exe " & TIME$
    ..where "setclock.exe" is a Windows Executable which, well, sets the clock using the approved API.

    You could drop the SHELL line when you compile the production version.

    Don't know if you have Windows compiler, but if you don't maybe some friend who does can whip up a little Windows program for you.

    (It's a thought).

    MCM

    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      There is a second clock?
      I've used the format TIME$ = "19.00" and never had a problem.


      ------------------
      How long is an idea? Write it down.

      Comment


      • #4
        There is a second clock?
        On (some) XT/AT systems, it was necessary to install a RTC card for the computer to maintain the date and time. In these systems, you had the date/time on the RTC card, and the date/time maintained by the OS (they could be different). As Tony wants to update the Windows clock, I very much doubt he is using an XT/AT computer!

        Though Tony doesn't state what version of Windows he is using, I can confirm that the TIME command (in a Command Prompt window) in Windows 2000 does update the "Windows" clock, but can't recall if this is also the case for Platform 1 OSs (though I am pretty sure it will). That being the case, I'm not sure why his DOS program would be having trouble doing this without knowing more about the method he is trying to use to update the clock.

        ------------------
        If you try to make something idiot-proof, someone will invent a better idiot.
        If you try to make something idiot-proof, someone will invent a better idiot.

        Comment


        • #5
          I am running PB/DOS in a Windows XP dos box… I have no trouble updating the system time, or the real time clock..
          and everything works great until I exit my program. Upon re-entering windows, the windows clock on the task bar
          has maintained its own time.. If I force an illegal shut-down the new time takes effect, otherwise windows closes
          and resets the “clocks” to its time..

          I will give Michael’s idea a go – thanks

          T


          ------------------

          Comment

          Working...
          X