Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, November 14, 2018 12:31 PM
I have a Windows application that when launched with the Task Scheduler on start up does not have focus (i.e. I cannot execute keyboard commands in the application until I click the application into focus). Focus is on the Desktop.
The application is started through Task Scheduler as it required Highest Privileges to launch (bypassing UAC prompt).
There only seems to be third party applications available which support automatic switch to the application *i.e. switch focus.
Is there a was I can switch the focus to the application? - like a batch file?
All replies (4)
Wednesday, November 14, 2018 1:46 PM
You would can make it with AHK (AutoHotKey)
You i'll set anything like
Run, notepad.exe
WinActivate, Untitled - Notepad
WinWaitActive, Untitled - Notepad
Return
Full documentation: https://autohotkey.com/docs/Tutorial.htm#s2
Friday, November 16, 2018 2:13 AM
Hi MattDW,
Thanks for posting your query.
You can try SendKeys.bat and refer to this post:
https://stackoverflow.com/questions/35988863/using-command-line-batch-to-switch-to-focus-on-app
Best regards,
Yilia
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, November 19, 2018 1:11 AM
Hi MattDW,
Is there anything I can do for you?
If you have any problems or concerns, please feel free to post here.
Best regards,
Yilia
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Wednesday, November 21, 2018 1:29 AM
Hi,
Just want to confirm the current situations.
Please feel free to let us know if you need further assistance.
Best regards,
Yilia
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].