I’m writing a batch file that I only want to run once a day, here is the code:
set ACTUALDATE=%date:~4,2%-%date:~7,2%-%date:~10,4%
set /p BEFOREDATE=<date.txt
if %ACTUALDATE% == %BEFOREDATE% GOTO L
echo %ACTUALDATE%>date.txt
start Minecraft/Launcher/Minecraft.exe
C:/Python24/python.exe timer.py
start "" cmd /c "echo Time is almost up!&echo(&pause"
tasklist /FI "IMAGENAME eq python.exe*32" 2>NUL
:L
C:/Python24/python.exe timer2.py
taskkill /f /im javaw.exe
This works fine, it runs and then terminates Minecraft after the time, which is judged based on the python files. This isn’t the problem, the problem is that the user is not super happy about this program, and I am trying to work around the fact he can just change the date on his computer and rerun the program.
Is there a way to set “ACTUALDATE” from a server or some sort so that he cannot change the date. If there is any way around this work around it would be greatly appreciated.
Thank you for the help.
you could use
net time \\servername(/set if you want to change the local time)