VOGONS

Common searches


First post, by BulmaSoft

User metadata
Rank Newbie
Rank
Newbie

Hello everyone.

I hope I'm writing in the correct segment of the forum.

What I would like to do is something like this:
(in a BAT file, running under DosBox)

If Time==(certain time, example 19:37) then (do something)

DosBox have the Time and Time /T command.
But I dont know how to use it, in the correct syntax way for this, under the If conndition (assuming that it is possible)?

Reply 1 of 6, by BulmaSoft

User metadata
Rank Newbie
Rank
Newbie

O well - nevermind;
Just to answer "to myself" here:

"If there is something that does not exist but I need it, then usually it's the best when I just sit down and compile it for myself"

That is to say;
I created tiny EXE file for DosBox just for this, so now when called (from a BAT file) it gives an output of the current time (in a seperate file), with the current time of the houf in the filename in HH format.

I call it "Time4bat.exe".

And in Bat file - just execute it
(It will create a new file)
Then - in a Bat file:

If exist 00.TME = it means it is midnight,
If exist 01.TME = it means it is 1h AM,
If exist 02.TME = it means it is 02h AM,
...
And so on.

It was that simple!
And it works!

I wish here to say thanks to: myself!
(I allways knew I was a great person!) 😁 😁 😁

Reply 5 of 6, by BulmaSoft

User metadata
Rank Newbie
Rank
Newbie
mrau wrote:

instead of spamming files You could use errorlevels; time will not always be so exact in an emulated environment without synchronisation;

If I knew how to do that - I would!

And Yes - DosBox does have the option to synchronise time with the host (on Android).
It is: Time /H
(/H switch)
And it works.

This is the Bat file that is being used (image)

Attachments

  • db1.png
    Filename
    db1.png
    File size
    123.98 KiB
    Views
    807 views
    File license
    Fair use/fair dealing exception