Solved

Running exe files in background

Posted on 2011-02-14
3
671 Views
Last Modified: 2012-06-21
Hi,

I want to run exe from bat file but the exe should run in background.. My bat file looks like
cd /d C:\Folder
C:\Folder\nxslt.exe  -t
C:\folder\input.xml
C:\folder\some.xsl -o
 C:\folder\output.xml >> ErrorLogs.log 2>&1

I tried using a vbs file also but it didn't worked.
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Folder\Example.bat" & Chr(34), 0
Set WshShell = Nothing
0
Comment
Question by:priyanka_kothari
3 Comments
 
LVL 6

Expert Comment

by:mslunecka
ID: 34889933
Try changing the code in your VB script where you run the batch file to this:

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("%comspec% /K C:\folder\example.bat"), 0, True
0
 
LVL 5

Expert Comment

by:_-MYFOX-_
ID: 34889983
0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 34893339
In BAT you can use the START command to start the EXE and keep running like:

start "" "C:\Folder\nxslt.exe"  -t

you can do START /? at a command line to see additional options, like starting minimized, etc.

~bp
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question