Download nircmd.exe from here create a script file. In it you place code, for example,
cmdwait 2000 sendkey enter press sendkey 1 press sendkey enter press cmdwait 2000 sendkey enter press sendkey 8080 press sendkey enter press
In my case, I put nircmd.exe and the msg.ncl file along the path C: \ nircmd. The start command will look like this
C:\nircmd>nircmd.exe script msg.ncl
As a result, you will launch the script, wait 2 seconds and press 1, then wait another 2 seconds, press again, let's say port 8080 and press inter. Theoretically, maybe you only have enough of these lines.
sendkey 1 press cmdwait 2000 sendkey 8080 press
I did not have the opportunity to test locally, since I do not know what code you are taking these commands.
Through the standard Windows Scheduler make the command run
C:\nircmd>nircmd.exe script msg.ncl
once an hour Everything.
Read the instructions on the page where to download the program itself. Maybe something else interesting and useful will seem to you.