Solved

# How to run bat/cmd batch file silently without opening console window

Posted on 2013-11-04
4,980 Views
I hope someone can help me out here I have a bat file located on the network share and I'm trying to run it with the task scheduler. What I'm looking for is a way to run this file silently without displaying a console window. I have tried  cmd.exe /c start \\Network path to the batch file but that did not work I get the error from task scheduler. Is there a other clean way to get this accomplished. Also I'm deploying  this task through GPO not sure if that makes any difference.

Thanks
0
Question by:btny
1 Comment

LVL 21

Accepted Solution

mcsween earned 500 total points
ID: 39622531
cmd /c \\path\to\batch\file.bat will run it then close after.

When you call the start command you would have to use that to call another cmd.exe process (which wouldn't make sense) as the batch file cannot be started natively (it isn't a program; it's the list of commands to run within the program.)

To run silently you will need to use powershell or vbscript.  A vbscript example is below.

Set wShell = CreateObject("WScript.Shell" )
wShell.Run chr(34) & "\\network\path\to\batch\file.bat" & Chr(34), 0

0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression