Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Running exe files in background

Posted on 2011-02-14
3
Medium Priority
?
675 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 59

Accepted Solution

by:
Bill Prew earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

876 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