Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Task scheduler Application and Focus

Tags:

windows-7

I need to run a task using the scheduler, the problem is that, if I double click on the executable, the program gets the focus and run in full screen, if I run the same executable using task scheduler, the command window remains on top and the application runs on the background, can please somebody help me?

cheers

like image 403
Fra Avatar asked May 24 '26 04:05

Fra


2 Answers

This is probably a bit late for you but I ran into the same problem with Google chrome not receiving focus when started by task scheduler, and this is how I fixed it:

Start Program field: C:\WINDOWS\System32\cmd.exe
Argument field: /c start "" "C:\Program Files\Chrome\Chrome.exe" --some-arguments

This will basically open up cmd.exe and pass the arguments to it, because /c is specified it will run those arguments and then close.

Since start will give anything started with it focus, chrome comes up with its window focused.

Have fun.

like image 102
Serdalis Avatar answered May 31 '26 07:05

Serdalis


I did manage to revolve the problem with a vbs script running my executable instead of running the executable directly from the task scheduler. So now the task scheduler runs my vbs script that runs the executable.

like image 26
Fra Avatar answered May 31 '26 08:05

Fra