Solved

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

Posted on 2013-11-04
4,870 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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…