supress the cmd window
Hi, please help to how to hide cmd window while running a batch file for running an exe.........
my batch file code shown as below:
@ECHO OFF
SET FileName=
Start /WAIT .\FolderName\ABC.exe
ECHO ON
Exit
while running this, C:\WINDOWS\System32\cmd.exe window shows....
but how to hide this window????
Create a shortcut to the batch file, go to the shortcut properties and change "Run" to "Minimised", then run the shortcut.
Aside from that, you can't (Unless you have an app running in the background to catch the window and hide it or something). A batch file means "Open a command prompt window and run the following:", it doesn't make sense not to have a window.
Aside from that, you can't (Unless you have an app running in the background to catch the window and hide it or something). A batch file means "Open a command prompt window and run the following:", it doesn't make sense not to have a window.
You don't need to exit the script explicitly, and 'echo' settings are per-command-window-instance, so there's no reason to turn it back on. Just have the 'start' as the last item, and the window should close immediately (while ABC.exe starts). That will help a little bit; but otherwise - like Evil Steve said.
Hi,
Thanks for the reply.
But this will not work...
The situation is that i need to use this batch file inside a wisw installation exe application as a pre requiste so that this batch will trigger at first....
So keeping a short cut of batch file will not work inside this msi.....
Do u know any other way to hide the cmd.exe windom when a batch file is executed....
Thanks.............
Thanks for the reply.
But this will not work...
The situation is that i need to use this batch file inside a wisw installation exe application as a pre requiste so that this batch will trigger at first....
So keeping a short cut of batch file will not work inside this msi.....
Do u know any other way to hide the cmd.exe windom when a batch file is executed....
Thanks.............
I assume you are telling the WISE installer maker to run the batch script?
Don't do that. Tell it to run the applications that the batch script currently runs.
Yes, 'set' and 'start' are applications. Or at least, they behave like applications; they should be usable in exactly the same way, via whatever interface you are given.
Don't do that. Tell it to run the applications that the batch script currently runs.
Yes, 'set' and 'start' are applications. Or at least, they behave like applications; they should be usable in exactly the same way, via whatever interface you are given.
One fullstop/period is usually sufficient at the end of a sentence [smile]
Is it not possible for you to get the msi to point direct directly at the executable, rather than indirectly through a batch file?
Unfortunately even with echos off a batch file will open command prompt, that's just how they work. No doubt it is possible to disable the window from showing but the technique, what it may involve, will likely be non-trivial and ugly.
Is it not possible for you to get the msi to point direct directly at the executable, rather than indirectly through a batch file?
Unfortunately even with echos off a batch file will open command prompt, that's just how they work. No doubt it is possible to disable the window from showing but the technique, what it may involve, will likely be non-trivial and ugly.
If you're launching that batch file via ShellExecute() you can simply pass SW_HIDE as the last parameter and it should make the window go away (although I've not tried it). It's documented at: http://msdn2.microsoft.com/en-us/library/bb762153(VS.85).aspx
What I'd suggest though is writing a small program that does exactly what the batch file does and running that. It's only a few lines of code.
What I'd suggest though is writing a small program that does exactly what the batch file does and running that. It's only a few lines of code.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement