Scripting Question

Completely invisible batch file.

04/16/2012 21798 views

I am trying to schedule a batch file to run completely invisible to the end user via KACE. It is running ok, but no matter what I try, it pops up a command prompt window for about a second. I have an invisible.vbs file that runs it completely invisible if I run it locally, and I have added it as a dependency on the KACE Script. Any help would be greatly appreciated.

The invisible.vbs script is this:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


My KACE script is this:

@echo off

wscript.exe "invisible.vbs" "myfile.bat"

0 Comments   [ + ] Show comments


Community Chosen Answer


There is no way to do this with a batch file alone. however if you truly require your batch file to not popup a window you can create and run the following vbs script to do exactly what you want

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "yourfile.bat" & Chr(34), 0
Set WshShell = Nothing

Copy the lines above to Notepad and save the file with .VBS extension. Now you just have to copy both files and call the vbs script.

Answered 04/16/2012 by: RandomITPro
4th Degree Black Belt

  • Should read..

    Set WshShell = CreateObject("WScript.Shell" )

    WshShell.Run chr(34) & "C:\Batch Files\syncfiles.bat" & Chr(34), 0

    Set WshShell = Nothing
  • I have tried this, and while it works perfectly when it is ran locally, when I push it from KACE it still pops up a command prompt. It is there for less than a second, so it's not a huge deal, but I would rather the end user not see anything at all.

All Answers


I use a Bat to Exe converter that has an option to compile the exe to run invisible. There are quite a few out there, but I've been using this one http://www.f2ko.de/programs.php?lang=en&pid=b2e

Answered 04/17/2012 by: andibogard
Blue Belt

  • I am out of the office today, but I think this may work for me. I ran a few tests locally, and it looks like it may. I will test it when I get back in the office.
  • iexpress is built into Windows 7.


Did you ever find a solution that worked for you on this?  I would like to get rid of that split second window as well because on scheduled live scripts even a blip can be annoying when you have various ones running throughout the day

Answered 09/10/2012 by: mposhaughnessy
Senior Yellow Belt


The utility I like for this purpose is Hidden Start at http://www.ntwind.com/software/hstart.html .

Not only does it hide the window, it can also delay and can handle UAC prompts.

Answered 04/20/2012 by: snissen
Fourth Degree Green Belt


I also tried adding start /min to the beginning of the KACE script.

Answered 04/16/2012 by: WGM_Jeff
4th Degree Black Belt


you could look into using the NirCmd tool (http://www.nirsoft.net/utils/nircmd.html). It should allow you to run your VBS by using the execmd parameter, and should execute this without anything visible on screen.

Answered 04/16/2012 by: pjgeutjens
Red Belt


Try @echo off
start /B Myapp.exe
in a batch file

Answered 04/16/2012 by: oreillyr
Fifth Degree Brown Belt

  • I tried this and it still flashed the command prompt on the screen.
  • sorry should read
    @echo off
    start /B Myapp.exe

A batch file is called by come.exe so there will always be that flash as it is called and then control handed back. You can't get rid of this in batch only behaviour in any reasonable way that I have seen.

You can make the flash so slight as to be almost imperceptible by renaming your batch as a .cmd file and adding @echo off as the first line. Since control isn't passed to a batch the flash is greatly reduced to be almost unnoticeable. 


Answered 11/26/2012 by: jdornan
Red Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ