Stop taskeng.exe window from popping up

More specifically to Daniel R Hicks' bounty/example, but I think it can still be applied to the original problem:

If it's a batch file being launched from Task Scheduler, then instead of just launching the Batch file minimized/invisible, you probably also need to modify the batch file itself to run it's commands invisibly.

So change:

cd C:\Users\danh\bin
"C:\Program Files\Java\jre7\bin\java.exe" Signature

To something like:

cd C:\Users\danh\bin
start /b "C:\Program Files\Java\jre7\bin\java.exe" Signature

Or perhaps eliminate the batch file completely and just do everything from the (VBS) script you're launching directly from the Task Scheduler.

Something like:

Set Shell = CreateObject("WScript.Shell")
Shell.CurrentDirectory = "C:\Users\danh\bin" 
Shell.Run "C:\Program Files\Java\jre7\bin\java.exe Signature", 0, False

Solution as implemented by DanH, in response to techie007's suggestions, satisfying the bounty:

One file, named RunSignatured.vbs, containing:

Set Shell = CreateObject("WScript.Shell")
Shell.CurrentDirectory = "C:\Users\danh\bin" 
Shell.Run "java.exe Signature", 0, False

Note that the above relies on java.exe being in path, since the technique does not work with the blank in Program Files when specifying a full path. There are no doubt other ways to work around this problem, but that's for others to discover.

Then add RunSignature.vbs as the "program/script" name in the "Action" in Task Scheduler.


You could run the scheduled tasks as a different user, that way they will no interact with your normal account's interactive desktop at all. This certainly seems to work on the Windows2003 servers I administer. Just be careful to make sure that file permissions and other authentication details are set such that the tasks can access what they need to when un as this different user.

Edit: Or instead of running a console tool directly you could have a small script that runs it using WScript.Shell.Run with the "minimise, no focus change" option:

' sample script: c:\scripts\test.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\location\of\tool\utility.exe", 7

then run this with the task scheduler (the command line being something like wscript c:\scripts\test.vbs) instead of calling the tool directly. You should be able to call batch files and other scripts that way too. There is also a "completely hide" option (replace the 7 above with a 0), though in either case the hide/minimise only controls the initial window: if the tool opens more itself then they may still steal focus as before.

See http://msdn.microsoft.com/en-us/library/d5fk67ky%28VS.85%29.aspx for a full list of options for the run method.


Try running your scheduled task like this:

C:\Windows\System32\cmd.exe /c start /b c:\fullpath\mybackup.bat

The start /b should start the application without creating a new window.

If this does not work, then you can create an standalone AutoIt script that will hide the taskeng.exe window. AutoIt scripts can be compiled to a .exe.

The .exe would be the first line in your mybackup.bat file. The AutoIt code would look like this:

WinSetState("taskeng", @SW_HIDE)