I want to see if a lock file modify date is more than a 5 seconds ago or it in the future (indicating the PC clock was changed back).
How can I say
- if file.modifydate < now – 5 seconds or modifydate > now
- run command a (command a will launch my Java app)
- else
- run command b (command b will send a UDP packet to a localhost port)
As Wimmel suggested, I will be using VBScript – well actually I will be using JScript in the same way VBScript would normally be used… because I am already familiar with JavaScript.
I posted this question: Windows XP and Up: JavaScript instead of VBScript?
Which has the code I will be using
for checking modify date/time
and code to exec my Java process
command b will be to send the UDP packet using one of the suggestions from Windows BAT or CMD: send some data to a localhost udp port.
The commands would probably be the same if I used VBScript/JScript so they should work fine.
The only thing missing is: VBScript/JScript Networking: Connect either UDP or TCP
If I could use a native function, it would definitely be better than an exec of command b.