0

I am running a VBScript (.vbs) file via Windows Scheduled Task.

On a Windows XP SP3 x86 machine, a command window is not shown when the task executes.

On a Windows Server 2003 R2 SP2 x64 machine, a command window is shown when the task executes.

Does anyone know why the difference in behavior and, in particular, how I can suppress the command window on the server?

Full version is Microsoft Windows Server 2003 R2 Enterprise Edition x64 (5.2.3790).

AdamRalph
  • 109
  • 1
  • 4
  • Does the scheduled task have anything to do with it. Perhaps one system is set to use `wscript` by default and the other is set to use `cscript`? – Zoredache Dec 07 '11 at 18:33
  • On both systems the scheduled task is configured to run the .vbs file and, I guess, let the file association take care of which executable is run. This is a very good point though - I will check which executable is being run on each system... when I get into the office tomorrow ;-). – AdamRalph Dec 07 '11 at 18:56

2 Answers2

0

The CMD window is being shown most likely because it is being run via cscript. The CMD window will be displayed if the user that the task is configured to run as, is logged in at the time it executes.

Jay Adams
  • 306
  • 1
  • 5
0

Change your scheduled task to launch via WScript similar to:

wscript //b //nologo <scriptname>
Mr. Smythe
  • 643
  • 1
  • 8
  • 13