Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

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

Posted on 2013-11-04
Medium Priority
5,424 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
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 22

Accepted Solution

mcsween earned 2000 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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Make the most of your online learning experience.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…
###### Suggested Courses
Course of the Month5 days, 20 hours left to enroll