However, as soon as I close the rdp session Send/SendEvent/SendInput of ^a, ^c, ^v and ^w fail to work. I've been able to google my way into other people having issues with VPS running scripts and it seems generally it is due to VPS not having a monitor.
Is there any workaround to make this work?
Solutions I tried but didn't help:
- converting script into the .exe and running it as a service
- switching from Send to SendEvent to SendInput
- Opening RDP from another VPS into the main VPS
Any ideas would be welcome! Thanks.
Script:
Code: Select all
MsgBox,, Warning, Pause what you're doing for a minute while the reddit followers script runs - Click OK to run the script, 30
Sleep, 2000
Run, https://www.reddit.com/notifications
Sleep, 1000
Send, {ENTER}
Sleep, 10000
Send {End}
Sleep, 1000
Send {End}
Sleep, 1000
Send {End}
Sleep, 1000
Send, ^a
Sleep, 1000
Send, ^c
Sleep, 1000
Run Notepad.exe
Sleep, 1000
Send, ^v
Sleep, 1000
Send, ^s
Sleep, 1000
Send, R.Followers Export - %A_Hour%.%A_Min%.%A_Sec% %A_DD%-%A_MM%-%A_YYYY%
Sleep, 3000
Send, {ENTER}
Sleep, 3000
Send, {ENTER}
Sleep, 1000
Send !{f4}
Sleep, 3000
Send, ^w
Sleep, 1000
MsgBox,, Warning, Scraping Complete Click OK to continue work, 30
return