Solved

Running exe files in background

Posted on 2011-02-14
3
667 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 51

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now