hi guys How can hide Command window when batch file runs this is my xp.bat file thank you "C:\wxxx\xp.bat"
use a .vbs file to run your batch file ... example .... HideBat.vbs Code: CreateObject("Wscript.Shell").Run "NAME_ME.bat",0,True "NAME_ME" change to name of your .bat file, that you wish to run hidden.
it is possible to hide the cmd window when a bat runs by using the program "hstart" --which is what I use for doing this example: @ echo off Start hstart.exe /NOCONSOLE "name.bat" there are also various other commands that can be used with "hstart" as well
There are some problems with this example. First of all if you are hiding the batch file, what would be the point in turning the echoing off, (you are not going to see it echo anyhow). Next is that when using the start command the first quoted string to follow it is often seen a the TITLE, that means there may be no batch file actually passed to hstart. Code: @START "" Hstart /NOWINDOW "My Batch.cmd" There should be no reason why you couldn't just run it like this either: Code: @Hstart /NOWINDOW "My Batch.cmd" The commands above assume version 1.1 of the application change to /NOCONSOLE for the earlier version.
the version i have uses /NOCONSOLE, and not /NOWINDOW, and you are probably right about the echo off, it's just habit i guess, but the other Start hstart.exe /NOCONSOLE "name.bat" is the proper syntax cause it will run the batch in question every time as long as the batch is in the same directory as hstart.exe, so go argue with someone else. i was just trying to help so don't be a dick
First things first, I definitely stated that /NOWINDOW was the correct parameter for version 1.1 and that /NOCONSOLE was correct for earlier version. All I have done is inform all readers that there are different versions and that their parameters have changed with those versions. On the second point, I'm going to give you the opportunity to practice and find out for yourself, (just in case there has been a delay in your reading and comprehension skills prior to writing). I am however 100% certain that using a quoted string without a TITLE whilst issuing the START command is problematic. A problem which is solved by providing a title, even an empty one as per my advice. In my book I had not argued, I posted information with intent only to help. It is you who has taken a contrary position. I'd sooner be a dick and correct that someone incapable of admitting lack of knowledge or a mistake.
and i'm telling you, that you are wrong, so face it, Start hstart.exe /NOCONSOLE "name.bat" works every time. try it for yourself before you argue with me some more, and you aren't trying to help, all you are trying to do is make yourself sound intelligent on a subject you are oblivious to here in the virtual world, and i got news for you, your rep here don't mean jack in the real world... i don't really care what you think you know, but don't tell me i'm wrong when you have no idea what you are talking about
Now read the above, which I've also highlighted in my previous posts just to be sure, and explain where I have told you that your command doesn't work. All I have done, let me say it again loud and clear, is issuing the START command and using a quoted string without a TITLE is often problematic. Best practice is therefore to use a TITLE, blank or otherwise.