How many times this articles has been read? 84
This article has 235 total words. (Including header)
It could be run silently using a Windows Script [gs file]. The Run Method allows you running a script in invisible mode. Create a .vbs
file like this one:
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "C:\Scheduled Jobs\mybat.bat" & Chr(34), 0
Set WinScriptHost = Nothing
...and schedule it. The second argument in this example sets the window style. 0 means "hide the window".
Complete syntax of the Run method:
object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])
Arguments:
object: WshShell object.strCommand: String value indicating the [gs command line] you want to run. You must include any parameters you want to pass to the executable file.intWindowStyle: Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.bWaitOnReturn: Optional. Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your [gs script]. If set to true, script execution halts until the program finishes, and Run returns any [gs error] code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code).SOURCE | LINK | LANGUAGE | ENGLISH |
| |
Run a .bat file in a scheduled task without a window (Batch DOS and VBScript) – http://heelpbook.altervista.org/?p=35910 – 18/02/2013 – 18:20 – HeelpBook – Visit http://www.heelpbook.net OR http://mobile.heelpbook.net on your tablet! #HeelpBook @HeelpBook