IfWinExist, Untitled - Notepad
WinActivate, Untitled - Notepad
Send, The quick brown fox jumped over the lazy dog.
MsgBox, 4, , yes the script ran.
This example runs fine if I trigger it manually, or as an .exe. The text gets added to the notepad file and the Message Box appears.
If I end my remote session and have task scheduler run the .exe for me, I come back to Notepad being active but blank, and the Message Box appears as well.
I've tried changing the Send to Input and SendInput, with the same result.