Server 2012 – Task Scheduler vbs files stuck at “OpenWith.exe”

windows-server-2012

Have recently set up a Windows Server 2012 and I have some scheduled tasks I need to set up that run .vbs files. These tasks are running ok on Server 2008 and the run ok when I launch them manually, however running them from Task Scheduler the vbs does not run and stays in "Running" state forever.

When I check Task Manager I see it creates a process called "OpenWith.exe".

It looks like task scheduler doesn't understand the .vbs file extension.

I have set the task to run as my user identity, when I am logged on but I do not see this window appear in my console session.

Has anyone come across this before?

Best Answer

The answer following some research seems to be that I needed to run the vbs with Cscript instead. Like so:

Cscript //nologo  "C:\myscript\script.vbs"